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