]> CyberLeo.Net >> Repos - FreeBSD/stable/10.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:43:51 +0000 (11:43 +0000)
committerjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 15 Mar 2015 11:43:51 +0000 (11:43 +0000)
commit494d112bdbcf18cda70c3b3198bb8dfc7c7924e6
treec5c58f7ca0e8b8c1057cc29eca7b7a0e1f0e0aea
parentdab4d8037e25aad49f59e41c55b4c0acfefb6a14
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/10@280027 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