aboutsummaryrefslogtreecommitdiff
path: root/sh.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Yesterday I make strsep_space include post-token whitespace,andersen2001-03-141-2/+1
| | | | | | | | so we should not be adding another " " between tokens. -Erik git-svn-id: svn://busybox.net/trunk/busybox@2079 69ca8d6d-28ef-0310-b511-8ec308f3f277
* I forgot to malloc space for the NULL.andersen2001-03-141-1/+1
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@2078 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Applied patch from Larry Doolittle to fix '>\na\n' bug. Should close bug #1132markw2001-03-141-3/+8
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2075 69ca8d6d-28ef-0310-b511-8ec308f3f277
* libc5 glob is pretty stupid and doesn't do GLOB_BRACE or GLOB_TILDEandersen2001-03-141-1/+8
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@2063 69ca8d6d-28ef-0310-b511-8ec308f3f277
* - Changed name of BB_FEATURE_SIMPLE_PROMPT to BB_FEATURE_SH_SIMPLE_PROMPTmarkw2001-03-141-3/+3
| | | | | | | | | | | | | | - Set BB_FEATURE_SH_STANDALONE_SHELL and BB_FEATURE_SH_APPLETS_ALWAYS_WIN to be off by default - Set BB_FEATURE_SH_SIMPLE_PROMPT to be on by default - Added some more magic to the Olympus section to make all the dependencies on the shell, cmdline editing, tab completion and friend work properly. - Tidied up the Olympus section with some whitespace. Checked the various scrips that parse through there and the extra whitespace shouldn't break anything. git-svn-id: svn://busybox.net/trunk/busybox@2061 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Update the lash shell (hopefully the last time...) so things likeandersen2001-03-131-64/+116
| | | | | | | | | echo "foo bar" and echo -n "foo\t\\\\\tbar" work as expected. Merge prompt printing work from Vladimir. -Erik git-svn-id: svn://busybox.net/trunk/busybox@2059 69ca8d6d-28ef-0310-b511-8ec308f3f277
* A fix from Larry Doolittle for some nasty segfaults when sh.c tried to free aandersen2001-03-121-3/+3
| | | | | | | | | corrupted cmd pointer, and where it would truncate a command line at the first double space. -Erik git-svn-id: svn://busybox.net/trunk/busybox@2047 69ca8d6d-28ef-0310-b511-8ec308f3f277
* When using wordexp, only try to use the expand commandandersen2001-03-101-12/+14
| | | | | | | | when something actually got expanded. Skip it otherwise. -Erik git-svn-id: svn://busybox.net/trunk/busybox@2038 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fixed a couple more cases. $FOO/bar ${FOO} and such now workandersen2001-03-091-4/+14
| | | | | | | | | without wordexp. Of course for stuff like ${1:-foo} you still need wordexp for them to work. -Erik git-svn-id: svn://busybox.net/trunk/busybox@2025 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Allow wordexp to be used if availableandersen2001-03-091-2/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2024 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Urg. Remove the debug noiseandersen2001-03-091-1/+0
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2023 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Ok, sh.c should be working now. Many thanks to Larry Doolittleandersen2001-03-091-85/+83
| | | | | | | | | for his timely help -- nearly all of the work in this patch is his. -Erik git-svn-id: svn://busybox.net/trunk/busybox@2022 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix sh.c for the glab case. I was messing things up forandersen2001-03-091-5/+6
| | | | | | | | single argument commands. It should now work as expected... -Erik git-svn-id: svn://busybox.net/trunk/busybox@2019 69ca8d6d-28ef-0310-b511-8ec308f3f277
* A '.' is a legal seperator.andersen2001-03-091-2/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2018 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Cleanup patch from Larryandersen2001-03-091-2/+5
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2016 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Add in 'trim' routine. Fix up sh.c so it works when wordexpandersen2001-03-081-11/+85
| | | | | | | | is not available. -Erik git-svn-id: svn://busybox.net/trunk/busybox@2015 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Remember to delete un-expandable variables, and do a better job of expandingandersen2001-03-081-6/+28
| | | | | | | | | shell-specific things in case the wordexp implementation is broken (ie. the stubbed out wordexp in uClibc). -Erik git-svn-id: svn://busybox.net/trunk/busybox@2011 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Rework environment variable handling to use wordexp, per a suggestion fromandersen2001-03-081-108/+83
| | | | | | | | | | | | Larry Doolittle a couple of months ago. This makes the stuff-expansion in lash be ever so standards compliant. This change needs testing by everyone, but appears to be solid enough to let us close bug #1090. It works for me; however, please test this change! -Erik git-svn-id: svn://busybox.net/trunk/busybox@2010 69ca8d6d-28ef-0310-b511-8ec308f3f277
* remove an unused variableandersen2001-03-071-1/+0
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1995 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix the memory leak. No really this time.andersen2001-03-061-7/+9
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@1989 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix func prototypeandersen2001-03-061-0/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1986 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fixed a memory leak in lash. It seems that close_all was calling close()andersen2001-03-061-1/+1
| | | | | | | | | directly instead of calling mark_closed(), which allowed the memory allocated by mark_open() to never be freed. -Erik git-svn-id: svn://busybox.net/trunk/busybox@1985 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Close open files before calling builtin_exec(). I've tested thisandersen2001-03-061-0/+1
| | | | | | | | and it fixes bug #1121. -Erik git-svn-id: svn://busybox.net/trunk/busybox@1984 69ca8d6d-28ef-0310-b511-8ec308f3f277
* This fixes lash so it handles environment variable expansion, regardlessandersen2001-02-201-17/+30
| | | | | | | | | | | of where the environment variables are located in an argument. This allows things like 'echo foo$1$SHELL' to expand the same way bash would expand it. Of course, to make this work I introduced a memory leak, and I am too tired to find a way to fix it. -Erik git-svn-id: svn://busybox.net/trunk/busybox@1867 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Commit Vladimir's latest cmdedit. I modified it slightly to ensureandersen2001-02-161-2/+1
| | | | | | | | | | | parse_prompt() would be called before cmdedit_init(), since cmdedit_init() calls cmdedit_setwidth() which uses cmdedit_prmt_len, which is set by parse_prompt(). Also, added a mod, so very narrow terminals should now wrap properly... This is working very nicely for me -- Vladimir has done some very good work. git-svn-id: svn://busybox.net/trunk/busybox@1839 69ca8d6d-28ef-0310-b511-8ec308f3f277
* This patch, put together by Manuel Novoa III, is a merge of workandersen2001-02-141-10/+7
| | | | | | | | | done by Evin Robertson (bug#1105) and work from Manuel to make usage messages occupy less space and simplify how usage messages are displayed. git-svn-id: svn://busybox.net/trunk/busybox@1805 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Apply a patch from Larry Doolittle to add "-all" and "-none" switchesandersen2001-02-011-1/+1
| | | | | | | | | | to multibuild.pl. I did a little formatting adjustments to make it _very_ obvious when things stop working. I also removed the USE_PROCFS config option -- just do the right thing when USE_DEVPS_PATCH is enabled. -Erik git-svn-id: svn://busybox.net/trunk/busybox@1739 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Create find_applet_by_name function. Save 32 bytes.kraai2001-02-011-7/+5
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1735 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Removed trailing \n from error_msg{,_and_die} messages.kraai2001-01-311-15/+15
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1732 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from Bryan Rittmeyer -- be more conservative by defaultandersen2001-01-301-0/+20
| | | | | | | | with the lash prompt. -Erik git-svn-id: svn://busybox.net/trunk/busybox@1720 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix up copyright msgs. Bump version to 0.49 in preparation forandersen2001-01-271-1/+1
| | | | | | | | a release. Update the website with release details. -Erik git-svn-id: svn://busybox.net/trunk/busybox@1697 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fixed a li'l thinko.markw2001-01-261-1/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1685 69ca8d6d-28ef-0310-b511-8ec308f3f277
* #define -> static const int. Also got rid of some big static buffers.markw2001-01-231-2/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1642 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Bug fix.andersen2001-01-231-2/+0
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1639 69ca8d6d-28ef-0310-b511-8ec308f3f277
* More printf cleanupsandersen2001-01-201-9/+9
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1622 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Needs to be NULL at init in all cases.andersen2001-01-051-1/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1545 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from larry doolittle to be ever so careful to cleanupandersen2001-01-051-16/+72
| | | | | | | all open file descriptors, lest wierdness happen later. git-svn-id: svn://busybox.net/trunk/busybox@1543 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Better label the globals.andersen2001-01-051-2/+7
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1542 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from Larry Doolittle to set values to static variables that live in theandersen2001-01-051-2/+15
| | | | | | | | | bss at runtime, since sh.c can call sh.c, which causes these variables to not be set to their defaults as god intended. -Erik git-svn-id: svn://busybox.net/trunk/busybox@1541 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix a segfault by only constructing the prompt when we need to. If we don'tkraai2001-01-051-2/+2
| | | | | | | do this we will segfault processing /etc/.profile since cwd isn't yet set. git-svn-id: svn://busybox.net/trunk/busybox@1538 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Move window size handling to cmdedit.c. Move prompt setup to ↵andersen2001-01-041-53/+33
| | | | | | setup_prompt_string() git-svn-id: svn://busybox.net/trunk/busybox@1533 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Cleanup from Gennady Feldman <gfeldman@mail.com>andersen2000-12-221-8/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1490 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Use busybox error handling functions wherever possible.kraai2000-12-221-5/+5
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1489 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Another sh.c patch from Larry Doolittle. This makes redirects work properlyandersen2000-12-211-37/+71
| | | | | | | | | | with non-forking shell builtins. Especially helpful for "read". This patch also beautifies builtin_fg_bg, clarifies the problems with run_command_predicate, makes if/then/else support the default, and corrects the sense of the BB_FEATURE_SH_ENVIRONMENT comment. git-svn-id: svn://busybox.net/trunk/busybox@1487 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix a warning in sh.c. Remove use of getline() in md5sum sinceandersen2000-12-201-1/+4
| | | | | | | nobody else uses it and it is a GNU extension anyways... git-svn-id: svn://busybox.net/trunk/busybox@1482 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Ok, this is a pretty major update to sh.c. I renamed all the variables andandersen2000-12-181-472/+618
| | | | | | | | | | | | | | | function names to conform with the style guide. I also did a lot of work on the if-then-alse-fi logic and added prototype (i.e. it segfaults when enabled) line continuation support. Furthermore, this patch includes Larry Doolittle's work on restructuring some of the data structures that represent the job and child_program, allowing several simplifications and fixing several bugs. -Erik git-svn-id: svn://busybox.net/trunk/busybox@1467 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Mem leak fix from Matt Kraaiandersen2000-12-121-5/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1441 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from Matt Kraai to fox sh.c escape problem such thatandersen2000-12-111-1/+3
| | | | | | | | running things like 'echo "\n\tHi\n\t\!"' and 'echo -e "\n\tHi\n\t\!"' behave as under bash. git-svn-id: svn://busybox.net/trunk/busybox@1423 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Put in i to getopt, so i will work...andersen2000-12-081-1/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1405 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Changed names of functions in utility.c and all affected files, to makemarkw2000-12-071-17/+17
| | | | | | | compliant with the style guide. Everybody rebuild your tags file! git-svn-id: svn://busybox.net/trunk/busybox@1398 69ca8d6d-28ef-0310-b511-8ec308f3f277