[pulseaudio-discuss] [PATCH 2/2] pactl: Stop parsing option when the first non-option is encountered

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Tue Apr 15 02:20:08 PDT 2014


On Tue, 2014-04-15 at 11:12 +0200, Peter Meerwald wrote:
> From: Peter Meerwald <p.meerwald at bct-electronic.com>
> 
> fix bug
> https://bugs.freedesktop.org/show_bug.cgi?id=77108
> 
> see getopt(3):
> ""By default, getopt() permutes the contents of argv as it scans, so that
>   eventually all the nonoptions are at the end.  Two other modes are also
>   implemented.   If  the first character of optstring is '+' or the envi‐
>   ronment variable POSIXLY_CORRECT is set, then option  processing  stops
>   as soon as a nonoption argument is encountered.  If the first character
>   of optstring is '-', then each nonoption argv-element is handled as  if
>   it were the argument of an option with character code 1.  (This is used
>   by programs that were written to expect options and other argv-elements
>   in any order and that care about the ordering of the two.)  The special
>   argument "--" forces an end of option-scanning regardless of the  scan‐
>   ning mode.""
> 
> prepend optstring with '+' to use POSIXLY_CORRECT mode
> 
> Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
> ---
>  src/utils/pactl.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Well, that was a simpler fix than I expected! Looks good to me.

The typo fix patch looks good too.

-- 
Tanu



More information about the pulseaudio-discuss mailing list