12794df244
snprintf(3) doesn't set errno in the tested cases. - If the same argument reference (for example %1) was specified more than once, the command didn't necessarily fit to the final command buffer. Fix this using a dynamic sbuf buffer. Add a few regression tests for the case. PR: bin/95079 No objections: freebsd-hackers
16 lines
226 B
Bash
16 lines
226 B
Bash
#!/bin/sh
|
|
# $FreeBSD$
|
|
|
|
SHELL=/bin/sh; export SHELL
|
|
|
|
ARG_MAX=$(getconf ARG_MAX)
|
|
ARG_MAX_HALF=$((ARG_MAX / 2))
|
|
|
|
apply 'echo %1 %1 %1' $(jot $ARG_MAX_HALF 1 1 | tr -d '\n') 2>&1
|
|
|
|
if [ $? -eq 0 ]; then
|
|
return 1
|
|
else
|
|
return 0
|
|
fi
|