bfae2529b8
It turns out job control in both hush and lash was broken by the signal handling in cmdedit.c. Disabling it makes the shells behave themselves again. hush isn't quite there, but is getting close... -Erik
Eric Andersen
2001-05-17 00:14:27 +00:00
2439a59828
Remove/replace the "div" call.
Eric Andersen
2001-05-16 18:53:34 +00:00
8f7a4ad442
Add missing include, noted by Larry Doolittle.
Matt Kraai
2001-05-16 17:05:03 +00:00
bf381a0ad8
Whoops. Forgot the x.
Matt Kraai
2001-05-16 15:52:23 +00:00
c55b8d41c1
Add xgethostbyname and herror_msg* functions.
Matt Kraai
2001-05-16 15:40:51 +00:00
59df6f7398
Change 'printf("%s\n", ...)' into 'puts(...)'. Noted and patched in hostname.c by Larry Doolittle.
Matt Kraai
2001-05-16 14:21:09 +00:00
bc604a2f41
Move init of a bunch of globals into main so we are at least a bit more reentrant. -Erik
Eric Andersen
2001-05-16 05:24:03 +00:00
f72f562b2f
Fix the behavior of local shell variables to match that of bash and ash. -Erik
Eric Andersen
2001-05-15 23:21:41 +00:00
9abfe85e96
Suggestion from Larry: no format string, use fputs instead.
Eric Andersen
2001-05-15 20:11:49 +00:00
50ae3102fb
Patch from Adam Heath <doogie@debian.org> to add arbitrary header support to wget, so it can now do funky interactive things with cgi scripts.
Eric Andersen
2001-05-15 17:51:37 +00:00
55f9872616
This patch from Adam Heath <doogie@debian.org>, makes print_file (used by cat, grep, sed, etc) quite a bit faster.
Eric Andersen
2001-05-15 17:48:09 +00:00
c911a4389b
Patch from Vladimir: 1) fixed a bug that could crash df, mount, and umount applets if the root device name was longer then the word "root" (/dev/loop1 vs /dev/root) - 2) severl functions needed static declaration in the umount applet 3) update declaration for function in last_char_is() in libbb
Eric Andersen
2001-05-15 17:42:16 +00:00
15649c11f3
Oops. I left in some debug noise.
Eric Andersen
2001-05-15 17:28:26 +00:00
20a69a77d2
Write set_local_var() and fixup lookup_param() so you can now use shell local variables. -Erik
Eric Andersen
2001-05-15 17:24:44 +00:00
78a7c99f7f
This patch covers one big part of variable handling. $ a=b foo should be handled correctly. $ a=b is parsed OK, but the actual variable setting is not yet written. Except for some weird exceptions related to quoting rules, this code passes (matches ash behavior) all the tests I threw at it.
Eric Andersen
2001-05-15 16:30:25 +00:00
be9f44a7df
Fix incorrect length passed to accept noted by Larry Doolittle.
Matt Kraai
2001-05-15 03:05:39 +00:00
336480fe6f
Added some testcases for grep and sed (many more could still be added)
Mark Whitley
2001-05-14 21:18:54 +00:00
d928accbbd
...Need to print just a few more newlines.
Mark Whitley
2001-05-14 20:44:26 +00:00
2416dfc3c9
A compromise solution for insmod
Eric Andersen
2001-05-14 20:03:04 +00:00
dd527d3c62
...And now that we're chomping lines, we need to re-add the newline later...
Mark Whitley
2001-05-14 19:53:08 +00:00
9de2659264
We will chomp() lines so REG_NEWLINE does not break stuff. Thanks, Matt.
Mark Whitley
2001-05-14 19:44:44 +00:00
35e59bed97
Fixed a subtle bug in the handling of -l and -c flags.
Mark Whitley
2001-05-14 19:40:32 +00:00
452cc1f293
Added REG_NEWLINE as cflags to xregcomp for normal addresses so EOL $ will work
Mark Whitley
2001-05-14 19:23:02 +00:00
9496466044
Follow symbolic links when searching for modules.
Matt Kraai
2001-05-14 18:27:25 +00:00
14d354312a
Per suggestion from Vladimir, eliminate check_wildcard_match(), which was only being used by insmod these days.
Eric Andersen
2001-05-14 17:07:32 +00:00
cb378a5267
Add missing periods and delete superfluous whitespace.
Matt Kraai
2001-05-14 06:35:15 +00:00
a17b3631fe
Do not ever change permissions on existing directories, only on directories we created while extracting a tarball. Fix based on bug report and patch from Konstantin Boldyshev <konst@linuxassembly.org> -Erik
Eric Andersen
2001-05-13 15:39:30 +00:00
95a349f427
When doing a 'wget -O -' turn on the quiet flag, lest the status bar noise get mingled with the retrieved webpage. -Erik
Eric Andersen
2001-05-13 00:55:54 +00:00
ddb00545b7
A patch from Aaron Lehmann <aaronl@vitelus.com> to fix a crash on a broken regexp.
Eric Andersen
2001-05-13 00:48:09 +00:00
4819c3d477
Make the locale stuff only do the getpid==1 check if BB_INIT is defined
Eric Andersen
2001-05-13 00:33:16 +00:00
1f3b9f297e
Added support for 'r' command in sed.
Mark Whitley
2001-05-11 22:27:13 +00:00
cfa88ecb72
Fix up some silly warnings
Eric Andersen
2001-05-11 18:08:16 +00:00
5f265b755a
Fix a segfault in lash, hush, and cmdedit. Each of these used xgetcwd, but did not check the return for a NULL, and then continued to call strlen on the NULL when the cwd had been removed from under it. -Erik
Eric Andersen
2001-05-11 16:58:46 +00:00
9d94deabd3
Use xgetcwd
Eric Andersen
2001-05-11 16:36:03 +00:00
238da24620
Fix the chown usage text, also thanks to Lars Kellogg-Stedman <lars@larsshack.org>
Eric Andersen
2001-05-11 16:31:46 +00:00
2b02ab9606
This patch from Lars Kellogg-Stedman, fixes the behavior of chown to be consistant with GNU chown, so that it follows symlinks (who cares about the perms on a link anyways?) unless the -h option is supplied. -Erik
Eric Andersen
2001-05-11 15:55:41 +00:00
eb5f433736
Check that putenv succeeded, suggested by Jonas Holmberg.
Matt Kraai
2001-05-11 15:16:28 +00:00
c96381be40
Fix env usage information.
Matt Kraai
2001-05-11 14:28:17 +00:00
5b44f48afc
Fix handling of '-' option and way that variables are added to the environment from Jonas Holmberg <jonas.holmberg@axis.com>. Fix handling of command options by adding + to getopt string.
Matt Kraai
2001-05-11 14:26:29 +00:00
f3e79ba6e3
Fix symlink removal problem noted by Erik Andersen.
Matt Kraai
2001-05-11 02:35:36 +00:00
6e91f69a0d
Add installation instructions from Tomas Pospisek <tpo_hp@sourcepole.ch>.
Matt Kraai
2001-05-10 14:12:20 +00:00
854125f6e6
Make stdio functions which can be interrupted by the progressmeter timer recover gracefully from EINTR.
Matt Kraai
2001-05-09 19:15:46 +00:00
d283e1cfe9
Bump version to 0.52pre
Eric Andersen
2001-05-09 17:31:27 +00:00
1a6d39b259
A few more structural updates for job control. -Erik
Eric Andersen
2001-05-08 05:11:54 +00:00
0a36de0580
Fix a stupid segfault caused by dereferencing a NULL ptr. -Erik
Eric Andersen
2001-05-08 04:25:46 +00:00
45e92ba2ce
This patch from Evin Robertson <nitfol@my-deja.com> fixes export so it works. This way leaks memory, but oh well. We will probably fix that when we get around to doing local variables.
Eric Andersen
2001-05-07 23:53:09 +00:00
8cd16d8fd3
This syncs things with Vladimir's latest patches. Also gets rid of useless 'const int' declarations. -Erik
Eric Andersen
2001-05-07 23:11:23 +00:00
186bf1defc
This is Vladimir's update to last_char_is(). Since 'char *' is the least common denominator, I modified it to use that (not const), which will minimize the need for casting elsewhere.
Eric Andersen
2001-05-07 23:10:16 +00:00
de0ca0cd9e
Silence cut so it doesn't whine during compilation
Eric Andersen
2001-05-07 23:07:17 +00:00
f3f9f3efa7
A patch from Vladimir to simplify chomp()
Eric Andersen
2001-05-07 23:02:39 +00:00
4ad13e5d95
A patch from Vladimir to simplify concat_path_file() and make it less likely to break.
Eric Andersen
2001-05-07 23:01:32 +00:00
c33ebc9741
A patch from Vladimir to use last_char_is(), and a patch from Larry to fix a silly bug when BB_FEATURE_VI_OPTIMIZE_CURSOR is not defined.
Eric Andersen
2001-05-07 22:57:47 +00:00
04b0354d8e
Patch from Vladimir to use last_char_is to simplify du.c
Eric Andersen
2001-05-07 22:49:43 +00:00
8f3e51b4ad
Patch from Vladimir to remove testing stuff from stty
Eric Andersen
2001-05-07 22:47:45 +00:00
8d35134ad8
A bug fix from Vladimir for a memory leak I stupidly added to which.c.
Eric Andersen
2001-05-07 22:45:06 +00:00
83a2ae2184
More hush updates from Larry: Update some comments. Generate partial placeholders for the missing builtins. Write builtin_umask. Properly treat exec without arguments as a means to open/close files within the running script. Implement "4<&-" that encodes for file descriptor closure.
Eric Andersen
2001-05-07 17:59:25 +00:00
7e1273edf7
Patch from Jim McQuillan to pass the terminal type to the remote host.
Eric Andersen
2001-05-07 17:57:45 +00:00
238bc4090d
Per comment from Jim McQuillan <jam@mcquil.com>, don't log syslogd startup/shutdown messages as KERN.EMERG, but use SYSLOG.INFO instead.
Eric Andersen
2001-05-07 17:55:05 +00:00
da7f095c12
Update comment re USE_SYSTEM_PWD_GRP -Erik
Eric Andersen
2001-05-07 17:51:34 +00:00
28355a36da
Per some comments from Lars Kellogg-Stedman <lars@larsshack.org>, make xreadlink() return NULL on failure, and make sure everyone uses the interface correctly. -Erik
Eric Andersen
2001-05-07 17:48:28 +00:00
822c3837f9
Another vi update from Sterling Huxley:
Eric Andersen
2001-05-07 17:37:43 +00:00
713b398700
woops, forgot the break statment
Glenn L McGrath
2001-05-07 12:06:37 +00:00
5bcfc9ba1a
Tolerate -q argument, if -q is passed give a warning and continue rather than just fail
Glenn L McGrath
2001-05-07 12:01:58 +00:00
cc0aa0f2d7
Actually we dont need to check if the device is nfs as it wont be stat'ed
Glenn L McGrath
2001-05-07 01:51:24 +00:00
1b62619446
woops, i shouldnt be so presumtuous? about what the error will be
Glenn L McGrath
2001-05-07 01:40:59 +00:00
3aae10014c
Device may not be a real filename
Glenn L McGrath
2001-05-07 01:38:03 +00:00
2e6c878763
Rewrite -c and -b processing to shrink code and eliminate buffer overrun.
Matt Kraai
2001-05-05 16:19:13 +00:00
6b8c550d88
include libbb.h after other includes
Glenn L McGrath
2001-05-05 03:19:12 +00:00
2dcfba7117
Larry's variant on Evin Robertson's fix to what I messed up trying to make job control work. This fix makes it so that hush doesn't error out when init hasn't set up job control, as in when init=/bin/sh
Eric Andersen
2001-05-04 22:13:37 +00:00
044a72d0d5
Larry suggested using concat_path_file() would be an even safer bet for 'which'. I ageed, so I whipped this up -- which revealed a bug in concat_path_file. It turns out that that a '/' can be appended from either the path _or_ the filename, but only the former was checked. -Erik
Eric Andersen
2001-05-04 22:04:24 +00:00
a0ba9f45fb
Wrote documentation and scripts for creating a busybox boot floppy. Initial revision.
Mark Whitley
2001-05-04 21:46:00 +00:00
d24f878546
Don't reset parents context when we encounter an terminator. Fixes if true; then if true; then true; fi; fi
Matt Kraai
2001-05-04 21:20:20 +00:00
7526f035f4
Fix a buffer overflow. Which accounted for the size of the path, plus the the '/', plus the size of the test command. It did not account for the terminating NULL, which overwrote the end of the string. -Erik
Eric Andersen
2001-05-04 20:47:33 +00:00
e5ffb911e8
If it fails to run a builtin, let it fall through to exec the real thing. -Erik
Eric Andersen
2001-05-04 16:30:29 +00:00
e6bf66eada
Fix two bugs reported by Ralph Jones.
Matt Kraai
2001-05-04 14:49:58 +00:00
b0aca921be
A todo update from larry to acknowledge the existance of hush
Eric Andersen
2001-05-03 17:35:48 +00:00
87d893c04b
devfs does not support creation of regular files. So change the test a bit so as to not possibly create a regular file. -Erik
Eric Andersen
2001-05-03 07:01:41 +00:00
6689140597
Remove summary header. Not present in GNU or SUSv2.
Matt Kraai
2001-05-03 04:45:40 +00:00
80abc45182
Move up waitpid error check so that errno isn't clobbered by tcsetpgrp.
Matt Kraai
2001-05-02 21:48:17 +00:00
adcbc12d85
Canonicalize path before trying to unmount it.
Matt Kraai
2001-05-02 21:24:51 +00:00
3425111bb9
Fix bug #1108 by always canonicalizing arguments.
Matt Kraai
2001-05-02 21:17:38 +00:00
0fcd447d59
Some more job control updates. It will now sucessfully background stuff. Good luck getting things back into the foreground though... -Erik
Eric Andersen
2001-05-02 20:12:03 +00:00
20a3069ec0
Don't treat newline as pipe separator when processing substitutions.
Matt Kraai
2001-05-02 17:52:49 +00:00
19ec9ee91e
Use .png for images (removing all .gifs) and make them all 90x36 -Erik
Eric Andersen
2001-05-02 17:19:25 +00:00
9f8caf134f
Fix $(...) construction. Noted and patched by Larry Doolittle <ldoolitt@recycle.lbl.gov>. I'm just a patch whore. :)
Matt Kraai
2001-05-02 16:26:12 +00:00
bafd94f154
First pass at getting job control working. This gets the infrastructure in place, but something is still missing/wrong in there. Testing with 'grep foo &' seems to put _hush_ into the background. Pondering... -Erik
Eric Andersen
2001-05-02 16:11:59 +00:00
1c8a59ab95
Use the current pgrp, not pid, when resetting the foreground process group. Fixes bizarre suspension when executing echo.
Matt Kraai
2001-05-02 15:37:09 +00:00
f162e7d09d
Don't segfault if the first word is the empty string.
Matt Kraai
2001-05-02 14:48:48 +00:00
e67c3ce327
Another update from Larry: Makes hush return code equal to that of the last command executed. Fixes the mode where input comes from a file.
Eric Andersen
2001-05-02 02:09:36 +00:00
e0244b0642
Skip headers with empty filenames, rather than stopping.
Matt Kraai
2001-05-01 21:12:31 +00:00
b9f5b82339
Another refinement, this time from Larry.
Eric Andersen
2001-05-01 16:24:32 +00:00
6d553ef200
Argh. Now we break non-pristine builds. Check a bit more carefully. -Erik
Eric Andersen
2001-05-01 14:54:35 +00:00
abde065935
Oops. The dangers of applying patches by hand...
Eric Andersen
2001-05-01 14:37:03 +00:00
4ed5e37d4b
Another hush update from Larry:
Eric Andersen
2001-05-01 01:49:50 +00:00
3f99b567b8
A patch from Larry to fix pristine source builds (again). I just can't seem to _not_ break it. Sigh.
Eric Andersen
2001-05-01 01:40:34 +00:00
aac75e5a78
Some more hush.c updates from Larry Doolittle.
Eric Andersen
2001-04-30 18:18:45 +00:00
0e9aef36fa
Oops. I was a bit too hasty and also changed applet_name.
Eric Andersen
2001-04-30 18:18:02 +00:00
8a633268ef
Made new xreadlink function for libbb and changed applets to use it instead of readlink(2).
Mark Whitley
2001-04-30 18:17:00 +00:00
6f34394454
These messages can be .rodata, so make them even more const. -Erik
Eric Andersen
2001-04-30 18:08:03 +00:00
65504ac12c
These do not need initial values. Let them live in the bss. -Erik
Eric Andersen
2001-04-30 18:07:24 +00:00