Commit Graph

256 Commits

Author SHA1 Message Date
Aaron Lehmann
49c024addd Remove ckfree, and replace all references with free. Remove freefunc,
which is also equivilent to free. Remove some if(x)free(x)
redundancies.
2002-08-02 06:39:47 +00:00
Eric Andersen
2276d83639 Fixup warnings and undefined operations that show up in gcc-3.1
-Erik
2002-07-11 11:11:56 +00:00
Eric Andersen
8e139871fe Patch from Stewart Brodie <stewart.brodie@pace.co.uk> to fix ash:
When alias support is not configured, ash believes that command parameters
that look like dd's "if=/dev/zero" are requests to set a temporary
environment variable whilst dd is running, even though it appears after the
command name.  This is caused by the re-use of the checkalias global variable
to indicate when both alias checking and environment variable checking.  The
failure to reset this flag is due to the reset action being performed only
inside the feature check CHECK_ASH_ALIAS.  Hence ash works as expected when
aliases are configured in, and fails when not.

Example script using 'date' with different settings of TZ:

# TZ=Europe/London
# export TZ
# date
Thu May 30 17:18:49 BST 2002
# TZ=America/New_York date
Thu May 30 12:19:10 EDT 2002
# date
Thu May 30 17:19:12 BST 2002
# date TZ=America/New_York
Thu May 30 12:19:30 EDT 2002    <----- wrong, should be BST time (or error!)
# date
Thu May 30 17:19:35 BST 2002

Attached is a patch against revision 1.52 of ash.c which moves the checks so
that checkalias is updated regardless of whether CONFIG_ASH_ALIAS is set.
With this patch applied, the command shown above which should generate an
error does generate an error.

I have tested this patch with the 'dd' command too and that now works
correctly.
2002-07-04 00:19:46 +00:00
Eric Andersen
887ca79f04 Scrub pwd.h and grp.h handling so we don't have to play any
silly games.
 -Erik
2002-07-03 23:19:26 +00:00
Eric Andersen
1a92376f00 Patch from vodz to only setenv PATH when PATH changes, which is much
smarter than my quick fix.
2002-06-06 12:07:28 +00:00
Robert Griebl
ea1a63a201 Fix for broken handling off BusyBox's own pwd/grp implementations
[Parts of this patch may overlap with my other two patches]
2002-06-04 20:10:23 +00:00
Robert Griebl
64f70cc755 Add --login support. This is the bash way of starting a shell that should
parse the profile files.
2002-05-14 23:22:06 +00:00
Eric Andersen
1c31501b1b Ensure that getenv("PATH") stays current, since otherwise cmdedit
(which calls getenv("PATH")) would not operate upon the current
PATH settings, which was really quite iritating.
 -Erik
2002-04-26 23:40:09 +00:00
Eric Andersen
54c14d7850 vodz noted this line (as imported from Debian) is wrong, and has since
been fixed upstream.
2002-04-24 23:14:06 +00:00
Tim Riker
497a88506e make ash prompt the same as other shells if cmdedit and fancyprompt 2002-04-13 05:37:10 +00:00
Eric Andersen
d35c5df08c Make private ash config options be public 2002-01-09 15:37:36 +00:00
Aaron Lehmann
438803311b ash patch: errname-diff 2001-12-31 06:16:54 +00:00
Aaron Lehmann
9a218bf979 ash patch: initvar-diff 2001-12-31 06:13:38 +00:00
Aaron Lehmann
1a6986699f ash patch: forkshell-diff 2001-12-31 06:12:48 +00:00
Aaron Lehmann
eec2bbb9bf ash patch: fgcmd-diff 2001-12-31 06:07:57 +00:00
Aaron Lehmann
2aef3a6bb9 ash patch: breakcmd-diff 2001-12-31 06:03:12 +00:00
Aaron Lehmann
95877b6756 ash patch: addfname-diff 2001-12-31 06:00:57 +00:00
Eric Andersen
ceef50b280 Patch from vodz to fix broken function prototype 2001-12-21 11:22:26 +00:00
Matt Kraai
1f0c43668a Remove == TRUE' tests and convert != TRUE' and `== FALSE' tests to use !. 2001-12-20 23:13:26 +00:00
Aaron Lehmann
b6ecbdc07d The ash ansification diff!
Please tell me if you notice any problems resulting from this.
2001-12-06 03:37:38 +00:00
Matt Kraai
c8227639db Change strdup calls to xstrdup (patch from Steve Merrifield). 2001-11-12 16:57:27 +00:00
Matt Kraai
a5f09c668e Use fopen wrapper. 2001-11-12 16:44:55 +00:00
Eric Andersen
ec07469a3e Patch from Aaron Lehmann <aaronl@vitelus.com>;
This diff does 2 things:

    1) removes an unnecessary function. saves 64 bytes on i386

    2) allows you to disable checking of mail (actually, it's now disabled
    by default). this would be a nice CML1 option, but for now it's a
    #(define|undef) in the C file like the other internal ash options.
    this saves an additional 352 bytes if you leave mail disabled.
2001-10-31 11:05:49 +00:00
Eric Andersen
69a20f0aca Patch from ASA <llb@udm.net.ru> to that source files
are properly passed their arguments.
2001-10-31 10:40:37 +00:00
Eric Andersen
72f9a4277f Add in some (theoretical) uClinux support. Some init cleanups 2001-10-28 05:12:20 +00:00
Eric Andersen
1a10eec178 Fixup the location of pwd.h and grp.h 2001-10-24 17:19:38 +00:00
Eric Andersen
a3483db55f Patch from vodz:
1) complete true: $ > /tmp/tmpfile
    2) the builtin pwd now does not unwrap symlinks
    3) reduce 680 bytes
2001-10-24 08:01:06 +00:00
Eric Andersen
bdfd0d78bc Major rework of the directory structure and the entire build system.
-Erik
2001-10-24 05:00:29 +00:00
Eric Andersen
d63dee4019 Add an option to make the shells not advertise their busybox nature 2001-10-19 00:22:23 +00:00
Eric Andersen
f4c208937c Remove the now unused ARITH_* defines
-Erik
2001-10-19 00:08:17 +00:00
Eric Andersen
74400ccfd0 Scrub up some function prototypes.
-Erik
2001-10-18 04:11:39 +00:00
Manuel Novoa III
8d0afde412 Commit my changes to xxreadtoken() to reduce code size. Also set defines
so that the table implementations of copynode, calcsize, and cmdtxt are
used.  Hopefully this will result in wider testing.  ;-)  If it breaks,
just unset the appropriate defines.
2001-09-11 01:14:02 +00:00
Eric Andersen
5bb1677f1d define IFS_BROKEN 2001-09-06 18:00:41 +00:00
Eric Andersen
88cec25e99 Patch from vodz to make ash cope with leading redirections
(i.e. '2>/dev/null ls rubbish') will now work.
2001-09-06 17:35:20 +00:00
Manuel Novoa III
c639a35f50 I stupidly forgot one level of pointer indirection in the cmdtxt(), calcsize(),
and copynode() table implementations.  Commit the fix but keep them disabled
until others check them out.  Uncomment "//#define CMDTXT_TABLE",
"//#define CALCSIZE_TABLE", and "//#define COPYNODE_TABLE" to try them out.
Saves over 600 bytes on i386.
2001-08-12 17:32:56 +00:00
Eric Andersen
dd9173c07f Fix a merging error 2001-08-10 21:11:56 +00:00
Manuel Novoa III
16815d4b45 A few bug fixes and significant size savings. Combined effort of
Vladimir N. Oleynik dzo@simtreas.ru, Aaron Lehmann aaronl@vitelus.com,
and myself.
2001-08-10 19:36:07 +00:00
Eric Andersen
80dd0863e2 Small size optimization from Aaron Lehmann 2001-08-10 18:42:04 +00:00
Eric Andersen
e20b7d844a Fix stupid grammar error. 2001-08-10 15:22:35 +00:00
Eric Andersen
3450636169 Latest patch from vodz. Adds a check for divide by zero in the posix
math suport, cleaner math syntax error checking, moves redundant signal
string tables (from kill and ash) into libbb and provides a few
cleanups elsewhere.
2001-08-02 05:02:46 +00:00
Matt Kraai
2d91deba45 Allow multiple shells to be enabled. 2001-08-01 17:21:35 +00:00
Eric Andersen
fa1c5aac51 Fix the let builtin (so we can close bug #1196) and remove the
nonstandard exp builtin.
 -Erik
2001-07-31 21:38:23 +00:00
Eric Andersen
74bcd16425 This incorporates Posix math support into ash. The Posix math support
was written by Aaron Lehmann <aaronl@vitelus.com> for busybox.  This
patch makes a few trivial changes to Aaron's code so that it can be
used (in theory) by the other shells as well...
 -Erik
2001-07-30 21:41:37 +00:00
Russ Dill
4db35647dd char renamed can never be negative on ARM (rp->renamed[i] != EMPTY) 2001-07-26 05:58:40 +00:00
Eric Andersen
bc4c030023 Cleanup from vodz 2001-07-17 01:14:06 +00:00
Eric Andersen
044228d5ec This is vodz' latest patch. Sorry it took so long...
1) ping cleanup (compile fix from this patch already applied).
    2) traceroute call not spare ntohl() now (and reduce size);
    3) Fix for functions not declared static in insmod, ash, vi and mount.
    4) a more simple API cmdedit :))
    5) adds "stopped jobs" warning to ash on Ctrl-D and fixes "ignoreeof" option
    6) reduce exporting library function index->strchr (traceroute), bzero->memset (syslogd)
2001-07-17 01:12:36 +00:00
Eric Andersen
7467c8d3b6 Patch from vodz:
Changed email address
    cmdedit API change
    optimizations for traceroute and md5sum
    added a new shared create_icmp_socket() function
2001-07-12 20:26:32 +00:00
Eric Andersen
8c145dc31b Fix a stupid search and replace bug... 2001-07-10 16:57:09 +00:00
Eric Andersen
6248355c6f vodz' latest update to ash.c 2001-07-10 06:09:16 +00:00
Eric Andersen
1c03923b0b Add in a shell tagline (per lash/hush behavior) to make it easier
to know which shell is in use.  Add in 'help' to list available
builtins, and fixup msh so it can do STANDALONE_SHELL.
 -Erik
2001-07-07 00:05:55 +00:00
Eric Andersen
3102ac4b58 This is vodz' latest ash update. 2001-07-06 04:26:23 +00:00
Eric Andersen
8df319b213 A bit of testing today showed that ASH_BBAPPS_AS_BUILTINS was
totally breaking the shell.  Simple thinge like 'FOO=100' caused
it to segfault.  It turns out that disabling "bltincmd" is a very
bad idea.
 -Erik
2001-07-05 05:24:12 +00:00
Eric Andersen
2870d964f8 Some updates to ash from vodz. Makes ash smaller. I made a few
changes, esp describing all the current ash configuration options.
Now ash adds 66k in the default configuration.
2001-07-02 17:27:21 +00:00
Eric Andersen
ec23c4920f Remove vodz from credits, per his request 2001-06-28 16:43:57 +00:00
Eric Andersen
df82f611c8 Scrub up the licensing block
-Erik
2001-06-28 07:46:40 +00:00
Eric Andersen
cb57d551a2 This a an ash applet I put together. It is similar to the one put
together by vodz, but uses newer sources, has the removed features
commented out instead of simply deleted (so they could be re-enabled)
and the builtins all work.  This adds 72k.
 -Erik
2001-06-28 07:25:16 +00:00