]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC r279779: env: Fix crash when -S string is not empty but no operand
authorjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 15 Mar 2015 11:56:52 +0000 (11:56 +0000)
committerjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 15 Mar 2015 11:56:52 +0000 (11:56 +0000)
commit3f68244356d95e24a0a7e20bfa0cc362cd4b8fbd
tree8057d18198660c58db43787b00688da5333fef93
parent44997e734426084df8150628b0a175e74265ddcd
MFC r279779: env: Fix crash when -S string is not empty but no operand
follows.

split_spaces() set argc in main() incorrectly, which caused trouble for
getopt().

Examples:
  env -S '\c'
  env -S -i

PR: 197769

git-svn-id: svn://svn.freebsd.org/base/stable/9@280029 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
tools/regression/usr.bin/env/regress-env.rgdata
tools/regression/usr.bin/env/regress-sb.rb
usr.bin/env/envopts.c