[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#33468: A bug with yes and --help
From: |
Bernhard Voelker |
Subject: |
bug#33468: A bug with yes and --help |
Date: |
Tue, 19 Feb 2019 09:24:30 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 |
On 2/18/19 11:20 AM, Assaf Gordon wrote:
> [...] what do you think ?
Thanks for driving this.
To Eric's suggestion, I'd remove the RESET_OPTIND function argument,
because it's never used.
Re. OPTIND: what about resetting the values of all involved externals
to their previous value?
+ int saved_opterr = opterr;
+ int saved_optind = optind;
+ int saved_optopt = optopt;
+ char *saved_optarg = optarg;
...
+ /* Restore previous values. */
+ opterr = saved_opterr;
+ optind = saved_optind;
+ optopt = saved_optopt;
+ optarg = saved_optarg;
In the attached, I've also changed the test a bit:
- remove unused _cleanup().
- add 'print_ver_ yes' to satisfy sc_env_test_dependencies,
- use case/esac to avoid spawning expr for the matching,
- and fix a missing "|| fail=1" in the final 'yes' test.
*BUT*: for 'yes', we'd introduce a regression due to option reordering:
$ /usr/bin/yes a -- --help | head -n1
a -- --help
$ src/yes a -- --help | head -n1
-- a --help
Any idea?
Thanks & have a nice day,
Berny
0001-all-detect-help-and-version-more-consistently.patch
Description: Text Data
gnulib-0001-long-options-add-parse_gnu_standard_options_only.patch
Description: Text Data
- bug#33468: A bug with yes and --help, Assaf Gordon, 2019/02/12
- bug#33468: A bug with yes and --help, Eric Blake, 2019/02/12
- bug#33468: A bug with yes and --help, Assaf Gordon, 2019/02/13
- bug#33468: A bug with yes and --help, Eric Blake, 2019/02/13
- bug#33468: A bug with yes and --help, Assaf Gordon, 2019/02/15
- bug#33468: A bug with yes and --help, Eric Blake, 2019/02/15
- bug#33468: A bug with yes and --help, Assaf Gordon, 2019/02/18
- bug#33468: A bug with yes and --help,
Bernhard Voelker <=
- bug#33468: A bug with yes and --help, Assaf Gordon, 2019/02/19
- bug#33468: A bug with yes and --help, Eric Blake, 2019/02/19
- bug#33468: A bug with yes and --help, Bernhard Voelker, 2019/02/21
- bug#33468: A bug with yes and --help, Bernhard Voelker, 2019/02/22
- bug#33468: A bug with yes and --help, Eric Blake, 2019/02/22
- bug#33468: A bug with yes and --help, Bernhard Voelker, 2019/02/22
- bug#33468: A bug with yes and --help, Bernhard Voelker, 2019/02/25
- bug#33468: A bug with yes and --help, Pádraig Brady, 2019/02/17