HomeFreeBSD

sh: accept fc options grouped behind one '-'

Description

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)

Details

Provenance
pstefAuthored on Aug 20 2022, 10:15 AM
Parents
rGead0fe475c5e: sh: nullify ENV in tests
Branches
Unknown
Tags
Unknown