HomeFreeBSD

Make COPYTREE_* work with POSIX-compliant sh -c

Description

Make COPYTREE_* work with POSIX-compliant sh -c

The COPYTREE_BIN and COPYTREE_SHARE macros use constructs like

sh -c 'command' -- arg0 arg1

and assume that $0 will expand to arg0 and $1 will expand to arg1.

Our current sh implements it that way. However, POSIX specifies that $0 will
expand to -- and $1 will expand to arg0, since the command string is an
operand and not an option-argument. Bug #220587 requests making sh
POSIX-compliant in this regard.

If the argument after the command string does not start with '-', the
current sh behaves as required by POSIX. Therefore, adjust the macros so
this is always the case.

PR: 222870
Approved by: portmgr (antoine)

Details

Provenance
jillesAuthored on
Parents
rP452152: - Update to 0.4.1
Branches
Unknown
Tags
Unknown