| Summary: | pactl parse_volume() cannot read negatives | ||
|---|---|---|---|
| Product: | PulseAudio | Reporter: | nguenthe+freedesktopbugzilla |
| Component: | tools | Assignee: | pulseaudio-bugs |
| Status: | RESOLVED FIXED | QA Contact: | pulseaudio-bugs |
| Severity: | blocker | ||
| Priority: | medium | CC: | lennart |
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux (All) | ||
| Whiteboard: | |||
| i915 platform: | i915 features: | ||
|
Description
nguenthe+freedesktopbugzilla
2014-04-06 15:35:40 UTC
You can use "--" like this to avoid the command line parser from interpreting -10% as an option:
pactl -- set-sink-volume 0 -10%
Requiring "--" is annoying, so this should be fixed anyway.
I think this can be easily fixed:
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
- while ((c = getopt_long(argc, argv, "s:n:h", long_options, NULL)) != -1) {
+ while ((c = getopt_long(argc, argv, "+s:n:h", long_options, NULL)) != -1) {
posting a patch
|
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.