]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sh: accept fc options grouped behind one '-'
authorPiotr Pawel Stefaniak <pstef@FreeBSD.org>
Sat, 20 Aug 2022 10:15:05 +0000 (12:15 +0200)
committerPiotr Pawel Stefaniak <pstef@FreeBSD.org>
Wed, 24 Aug 2022 18:21:23 +0000 (20:21 +0200)
commit6480563d0678662301b04c010d4f96f05283fc12
treecee7752cb7231033f0f311962c878c0552cd7207
parentead0fe475c5e30a94e01cead919a2f1e4bc38c3b
sh: accept fc options grouped behind one '-'

As per Utility Syntax Guidelines, accept both forms: -l -n and -ln.

To do that, anticipate the source string for the next option that will
be parsed by nextopt(). It's not always *argptr, sometimes it is
nextopt_optptr.

To simplify the check for not_fcnumber, slightly modify nextopt() to
always nullify nextopt_optptr in cases where it would have been set
to point to a NUL character.

(cherry picked from commit 755a1be6d015287763b0f336d4e9b8179615f511)
bin/sh/histedit.c
bin/sh/options.c
bin/sh/tests/builtins/Makefile
bin/sh/tests/builtins/fc3.0 [new file with mode: 0644]
bin/sh/tests/builtins/fc3.0.stderr [new file with mode: 0644]
bin/sh/tests/builtins/fc3.0.stdout [new file with mode: 0644]