aboutsummaryrefslogtreecommitdiff
path: root/sh.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* #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
* Bettwr document the hidden internal sh.c #defines, and which folksandersen2000-12-061-2/+10
| | | | | | | might want to use... git-svn-id: svn://busybox.net/trunk/busybox@1390 69ca8d6d-28ef-0310-b511-8ec308f3f277
* patch from Larry Doolittle to rename BB_FEATURE_SH_BUILTINS_ALWAYS_WINandersen2000-12-061-2/+2
| | | | | | | to the more pedantically correct BB_FEATURE_SH_APPLETS_ALWAYS_WIN. git-svn-id: svn://busybox.net/trunk/busybox@1386 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Stop using TRUE and FALSE for exit status.kraai2000-12-011-21/+21
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1360 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Apply some patches from Gennady Feldman <gfeldman@mail.com> toandersen2000-11-301-39/+65
| | | | | | | | . /etc/profile, and to emulate bash prompt. I've cleaned up his patches a bit and all looks good now... git-svn-id: svn://busybox.net/trunk/busybox@1359 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from Larry Doolittle (with minor touchups from me so everything compilesandersen2000-11-301-0/+1
| | | | | | | | and works) to use the applet definitions in applets.h to autogenerate the applet function and usage prototypes. git-svn-id: svn://busybox.net/trunk/busybox@1354 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix escape char problem.andersen2000-11-301-4/+13
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1353 69ca8d6d-28ef-0310-b511-8ec308f3f277
* "I will always compile before I commit."andersen2000-11-171-1/+1
| | | | | | | | | "I will always compile before I commit." "I will always compile before I commit." -Erik git-svn-id: svn://busybox.net/trunk/busybox@1324 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix up builtin overrides, and hack in the binary search for findingandersen2000-11-171-28/+32
| | | | | | | matching applets into the shell. git-svn-id: svn://busybox.net/trunk/busybox@1323 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Add in a new FEATURE (off by default) BB_FEATURE_SH_BUILTINS_ALWAYS_WIN.andersen2000-11-171-1/+18
| | | | | | | Make the sh default to using external commands when a path is provided. git-svn-id: svn://busybox.net/trunk/busybox@1321 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from Gennady Feldman <gfeldman@tradeline.net> to:andersen2000-11-141-23/+34
| | | | | | | | | 1. Opens redirections w/ the right access. 2. Doesn't do globbing for every single parameter (so it doesn't stat every parameter). git-svn-id: svn://busybox.net/trunk/busybox@1299 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Consolidate handling of some fopen failures.kraai2000-09-271-4/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1136 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Renamed "internal.h" to the more sensible "busybox.h".andersen2000-09-251-1/+1
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@1119 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Add in exec support (patch from Torbj?rn Axelsson <torax@cendio.se>)andersen2000-09-211-1/+16
| | | | | | | | and disable backticks (since they are still wierdly broken in some cases. git-svn-id: svn://busybox.net/trunk/busybox@1085 69ca8d6d-28ef-0310-b511-8ec308f3f277
* I think these featires are fairly safe...andersen2000-09-191-2/+2
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@1070 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Avoid segfaults by not using snprintf to copy strings.kraai2000-09-191-1/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1069 69ca8d6d-28ef-0310-b511-8ec308f3f277
* "exit NUMBER" should exit, not returnproski2000-09-151-1/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1054 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Backslashes shouldn't be treated as backticks.kraai2000-09-141-10/+11
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1048 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Copy the string terminator.kraai2000-09-141-1/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1047 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Don't fork for the . (source) command so that environment settings arekraai2000-09-131-1/+2
| | | | | | | preserved. git-svn-id: svn://busybox.net/trunk/busybox@1040 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix unchecked calls to {m,c,re}alloc so that they print an error andkraai2000-09-131-16/+15
| | | | | | | exit rather than segfaulting (what an improvement). git-svn-id: svn://busybox.net/trunk/busybox@1038 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Reset optind so that getopt works in busybox applets called directly by sh.kraai2000-09-061-17/+7
| | | | | | | Change the behavior of -c to correctly handle $1..$9. git-svn-id: svn://busybox.net/trunk/busybox@1014 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Turn off some debug noise.andersen2000-08-211-2/+2
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@969 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Clean up the nasty blunder I'd made of how different behaviors happen.andersen2000-07-281-14/+16
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@918 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Oops. Forgot an ifdefandersen2000-07-281-0/+2
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@915 69ca8d6d-28ef-0310-b511-8ec308f3f277
* More sh updates (with related changes to everything else). Switchedandersen2000-07-281-61/+118
| | | | | | | | | to using getopt and cleaned up the resulting mess. if-then-else-fi is now basically working (given a bunch of constraints). -Erik git-svn-id: svn://busybox.net/trunk/busybox@913 69ca8d6d-28ef-0310-b511-8ec308f3f277
* More shell features.... if-then-else-fi is now basically usable (disableandersen2000-07-271-113/+239
| | | | | | | | | by default pending further debugging). Added in some basic shell environment support (i.e. $?, $0-$9, $$, $!, $#). -Erik git-svn-id: svn://busybox.net/trunk/busybox@912 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Minor style cleanups.andersen2000-07-261-8/+9
| | | | git-svn-id: svn://busybox.net/trunk/busybox@910 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Finish off fixing up the memleaks (I think). Added the beginnings ofandersen2000-07-251-38/+123
| | | | | | | | some if-then-else-fi support (nonfunctional and turned off) -Erik git-svn-id: svn://busybox.net/trunk/busybox@905 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Sigh -- can't sleep. Clean up some mem leaks, fixed some bugs.andersen2000-07-181-39/+43
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@872 69ca8d6d-28ef-0310-b511-8ec308f3f277
* New message added to messages.c: full_versionproski2000-07-171-1/+5
| | | | | | | Used where possible git-svn-id: svn://busybox.net/trunk/busybox@871 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Backtick support to infinite (memory limited) levels of nesting isandersen2000-07-171-30/+85
| | | | | | | | | | | | | | | now implemented... So now busybox shell can do cool stuff like: /home/andersen/CVS/busybox # echo foo `wc README` bar foo 71 422 2951 README bar I love writing cool new features.... Muhahahaha... (I think this is leaking a little bit of memory every time it expands a backtick process, so I still needs to do a bit of cleanup...) -Erik git-svn-id: svn://busybox.net/trunk/busybox@867 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Extract usage information into a separate file.kraai2000-07-161-8/+0
| | | | git-svn-id: svn://busybox.net/trunk/busybox@864 69ca8d6d-28ef-0310-b511-8ec308f3f277