]> code.delx.au - pulseaudio/commit
pactl: Stop parsing option when the first non-option is encountered
authorPeter Meerwald <p.meerwald@bct-electronic.com>
Tue, 15 Apr 2014 08:58:21 +0000 (10:58 +0200)
committerPeter Meerwald <pmeerw@pmeerw.net>
Tue, 15 Apr 2014 21:53:13 +0000 (23:53 +0200)
commit997e369691496be4ecfe38e3516f7e007ed69a7b
treef643493ca2c268786580a7da865abc5d6c604a4d
parent3ad4857070153d05a91c91c9c64a15c911b4b181
pactl: Stop parsing option when the first non-option is encountered

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@pmeerw.net>
src/utils/pactl.c