summaryrefslogtreecommitdiffstats
path: root/usr.bin/env/envopts.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r279779: env: Fix crash when -S string is not empty but no operandjilles2015-03-151-2/+2
| | | | | | | | | | | | | follows. split_spaces() set argc in main() incorrectly, which caused trouble for getopt(). Examples: env -S '\c' env -S -i PR: 197769
* Fix minor memory leak when expanding ${variable}sgad2005-07-181-1/+5
| | | | | Noticed by: Dave Hart MFC plans: after checking with re@
* Fix two minor parsing bugs in -S processing:gad2005-07-131-14/+23
| | | | | | | | | | | 1) An unquoted space is always a separator, even when not "in_arg". 2) When a new destination buffer must be allocated during variable substitution, only copy data from the active buffer to the new one when we *are* "in_arg". These were noticed when testing variable-substitution of variables which have null values, and are not inside quoted strings... MFC plans: after a few days, and re@ approval...
* Fix a bug where the value of ${SOMEVAR} would simply disappear if theregad2005-06-211-23/+48
| | | | | | | | was a separator character immediately before it. This wasn't likely to happen in #-lines, but we might as well get it right. Also fix it so that "" and "" will create a zero-length argument. Approved by: re (blanket `env')
* Add the '-S' and '-P' options. The '-S' option can be used to splitgad2005-06-201-0/+430
apart a string, and supports some text substitutions. This can be used to provide all the flexibility (and more!) that was lost by recent changes to how the kernel parses #!-lines in shell scripts. The '-P' option provides a way to specify an alternate set of directories to use when searching for the 'utility' program to run. This way you can be sure what directories are used for that search, without changing the value of PATH that the user has set. Note that on FreeBSD 6.0, this option is worthless unless the '-S' option is also used. Approved by: re (blanket `env')
OpenPOWER on IntegriCloud