Matt Kraai [Thu, 17 May 2001 01:02:58 +0000 (01:02 -0000)]
Always print a newline after a matching substitution.
Eric Andersen [Thu, 17 May 2001 00:14:27 +0000 (00:14 -0000)]
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 [Wed, 16 May 2001 18:53:34 +0000 (18:53 -0000)]
Remove/replace the "div" call.
Matt Kraai [Wed, 16 May 2001 17:05:03 +0000 (17:05 -0000)]
Add missing include, noted by Larry Doolittle.
Matt Kraai [Wed, 16 May 2001 15:52:23 +0000 (15:52 -0000)]
Whoops. Forgot the x.
Matt Kraai [Wed, 16 May 2001 15:40:51 +0000 (15:40 -0000)]
Add xgethostbyname and herror_msg* functions.
Matt Kraai [Wed, 16 May 2001 14:21:09 +0000 (14:21 -0000)]
Change 'printf("%s\n", ...)' into 'puts(...)'. Noted and patched in hostname.c
by Larry Doolittle.
Eric Andersen [Wed, 16 May 2001 05:24:03 +0000 (05:24 -0000)]
Move init of a bunch of globals into main so we are at least
a bit more reentrant.
-Erik
Eric Andersen [Tue, 15 May 2001 23:21:41 +0000 (23:21 -0000)]
Fix the behavior of local shell variables to match that of bash and ash.
-Erik
Eric Andersen [Tue, 15 May 2001 20:11:49 +0000 (20:11 -0000)]
Suggestion from Larry: no format string, use fputs instead.
Eric Andersen [Tue, 15 May 2001 17:51:37 +0000 (17:51 -0000)]
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 [Tue, 15 May 2001 17:48:09 +0000 (17:48 -0000)]
This patch from Adam Heath <doogie@debian.org>, makes print_file
(used by cat, grep, sed, etc) quite a bit faster.
Eric Andersen [Tue, 15 May 2001 17:42:16 +0000 (17:42 -0000)]
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 [Tue, 15 May 2001 17:28:26 +0000 (17:28 -0000)]
Oops. I left in some debug noise.
Eric Andersen [Tue, 15 May 2001 17:24:44 +0000 (17:24 -0000)]
Write set_local_var() and fixup lookup_param() so you can now use
shell local variables.
-Erik
Eric Andersen [Tue, 15 May 2001 16:30:25 +0000 (16:30 -0000)]
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.
If someone now writes set_local_var(), and updates lookup_param()
to match, we can claim success!
- Larry
Matt Kraai [Tue, 15 May 2001 03:05:39 +0000 (03:05 -0000)]
Fix incorrect length passed to accept noted by Larry Doolittle.
Mark Whitley [Mon, 14 May 2001 21:18:54 +0000 (21:18 -0000)]
Added some testcases for grep and sed (many more could still be added)
Mark Whitley [Mon, 14 May 2001 20:44:26 +0000 (20:44 -0000)]
...Need to print just a few more newlines.
Eric Andersen [Mon, 14 May 2001 20:03:04 +0000 (20:03 -0000)]
A compromise solution for insmod
Mark Whitley [Mon, 14 May 2001 19:53:08 +0000 (19:53 -0000)]
...And now that we're chomping lines, we need to re-add the newline later...
Mark Whitley [Mon, 14 May 2001 19:44:44 +0000 (19:44 -0000)]
We will chomp() lines so REG_NEWLINE does not break stuff. Thanks, Matt.
Mark Whitley [Mon, 14 May 2001 19:40:32 +0000 (19:40 -0000)]
Fixed a subtle bug in the handling of -l and -c flags.
Mark Whitley [Mon, 14 May 2001 19:23:02 +0000 (19:23 -0000)]
Added REG_NEWLINE as cflags to xregcomp for normal addresses so EOL $ will work
Matt Kraai [Mon, 14 May 2001 18:27:25 +0000 (18:27 -0000)]
Follow symbolic links when searching for modules.
Eric Andersen [Mon, 14 May 2001 17:07:32 +0000 (17:07 -0000)]
Per suggestion from Vladimir, eliminate check_wildcard_match(), which
was only being used by insmod these days.
Also, I spent a minute adjusting insmod so that it first searches
/lib/modules/`uname -r` and then (if that fails) searches /lib/modules,
which makes bb insmod behave much more like the real insmod, and should
avoid nasty surprises (such as the recent "Modutils vs. Busybox..."
thread).
-Erik
Matt Kraai [Mon, 14 May 2001 06:35:15 +0000 (06:35 -0000)]
Add missing periods and delete superfluous whitespace.
Eric Andersen [Sun, 13 May 2001 15:39:30 +0000 (15:39 -0000)]
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 [Sun, 13 May 2001 00:55:54 +0000 (00:55 -0000)]
When doing a 'wget -O -' turn on the quiet flag, lest the status bar
noise get mingled with the retrieved webpage.
-Erik
Eric Andersen [Sun, 13 May 2001 00:48:09 +0000 (00:48 -0000)]
A patch from Aaron Lehmann <aaronl@vitelus.com> to fix a
crash on a broken regexp.
Eric Andersen [Sun, 13 May 2001 00:33:16 +0000 (00:33 -0000)]
Make the locale stuff only do the getpid==1 check if BB_INIT is defined
Mark Whitley [Fri, 11 May 2001 22:27:13 +0000 (22:27 -0000)]
Added support for 'r' command in sed.
Eric Andersen [Fri, 11 May 2001 18:08:16 +0000 (18:08 -0000)]
Fix up some silly warnings
Eric Andersen [Fri, 11 May 2001 16:58:46 +0000 (16:58 -0000)]
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 [Fri, 11 May 2001 16:36:03 +0000 (16:36 -0000)]
Use xgetcwd
Eric Andersen [Fri, 11 May 2001 16:31:46 +0000 (16:31 -0000)]
Fix the chown usage text, also thanks to Lars Kellogg-Stedman <lars@larsshack.org>
Eric Andersen [Fri, 11 May 2001 15:55:41 +0000 (15:55 -0000)]
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
Matt Kraai [Fri, 11 May 2001 15:16:28 +0000 (15:16 -0000)]
Check that putenv succeeded, suggested by Jonas Holmberg.
Matt Kraai [Fri, 11 May 2001 14:28:17 +0000 (14:28 -0000)]
Fix env usage information.
Matt Kraai [Fri, 11 May 2001 14:26:29 +0000 (14:26 -0000)]
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 [Fri, 11 May 2001 02:35:36 +0000 (02:35 -0000)]
Fix symlink removal problem noted by Erik Andersen.
Matt Kraai [Thu, 10 May 2001 14:12:20 +0000 (14:12 -0000)]
Add installation instructions from Tomas Pospisek <tpo_hp@sourcepole.ch>.
Matt Kraai [Wed, 9 May 2001 19:15:46 +0000 (19:15 -0000)]
Make stdio functions which can be interrupted by the progressmeter timer
recover gracefully from EINTR.
Eric Andersen [Wed, 9 May 2001 17:31:27 +0000 (17:31 -0000)]
Bump version to 0.52pre
Eric Andersen [Tue, 8 May 2001 05:11:54 +0000 (05:11 -0000)]
A few more structural updates for job control.
-Erik
Eric Andersen [Tue, 8 May 2001 04:25:46 +0000 (04:25 -0000)]
Fix a stupid segfault caused by dereferencing a NULL ptr.
-Erik
Eric Andersen [Mon, 7 May 2001 23:53:09 +0000 (23:53 -0000)]
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 [Mon, 7 May 2001 23:11:23 +0000 (23:11 -0000)]
This syncs things with Vladimir's latest patches. Also gets
rid of useless 'const int' declarations.
-Erik
Eric Andersen [Mon, 7 May 2001 23:10:16 +0000 (23:10 -0000)]
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 [Mon, 7 May 2001 23:07:17 +0000 (23:07 -0000)]
Silence cut so it doesn't whine during compilation
Eric Andersen [Mon, 7 May 2001 23:02:39 +0000 (23:02 -0000)]
A patch from Vladimir to simplify chomp()
Eric Andersen [Mon, 7 May 2001 23:01:32 +0000 (23:01 -0000)]
A patch from Vladimir to simplify concat_path_file() and
make it less likely to break.
Eric Andersen [Mon, 7 May 2001 22:57:47 +0000 (22:57 -0000)]
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 [Mon, 7 May 2001 22:49:43 +0000 (22:49 -0000)]
Patch from Vladimir to use last_char_is to simplify du.c
Eric Andersen [Mon, 7 May 2001 22:47:45 +0000 (22:47 -0000)]
Patch from Vladimir to remove testing stuff from stty
Eric Andersen [Mon, 7 May 2001 22:45:06 +0000 (22:45 -0000)]
A bug fix from Vladimir for a memory leak I stupidly
added to which.c.
Eric Andersen [Mon, 7 May 2001 17:59:25 +0000 (17:59 -0000)]
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 [Mon, 7 May 2001 17:57:45 +0000 (17:57 -0000)]
Patch from Jim McQuillan to pass the terminal type to the remote host.
Eric Andersen [Mon, 7 May 2001 17:55:05 +0000 (17:55 -0000)]
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 [Mon, 7 May 2001 17:51:34 +0000 (17:51 -0000)]
Update comment re USE_SYSTEM_PWD_GRP
-Erik
Eric Andersen [Mon, 7 May 2001 17:48:28 +0000 (17:48 -0000)]
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 [Mon, 7 May 2001 17:37:43 +0000 (17:37 -0000)]
Another vi update from Sterling Huxley:
- All of the ESC sequences are now in variables. This should make
re-targeting for other terminals easier.
- The initial screen draw does not force out every single column.
Should be faster.
- The place_cursor() routine trys to be smarter about moving the
cursor. This is optional based on BB_FEATURE_VI_OPTIMIZE_CURSOR.
- The 't' and 'f' intra-line positioning commands were added.
They can now be used as targets in 'c' and 'd' commands, i.e.,
dfx - delete from dot to next 'x'
dtx - delete from dot to the char before next 'x'
- show_status_line() uses a static int checksum to remember what
is currently displayed on the screen and not re-draw the status
line unless it has changed.
- Some of the code in refresh() was moved out to format_line().
refresh() trys to send out the smallest segment containing
the changed chars rather than the whole line.
- Added "flash" to the :set command to specify if error indication
should be by flashing the screen or ringing the bell.
- Changed the rawmode() routine so that it turns off the
NL -> CR NL translation. On output of a NL, the OS will not add
a CR.
- If vi was started as "view", with global read-only mode,
and another file is opened, the file is opened read-only
rather than read+write.
Glenn L McGrath [Mon, 7 May 2001 12:06:37 +0000 (12:06 -0000)]
woops, forgot the break statment
Glenn L McGrath [Mon, 7 May 2001 12:01:58 +0000 (12:01 -0000)]
Tolerate -q argument, if -q is passed give a warning and continue rather than just fail
Glenn L McGrath [Mon, 7 May 2001 01:51:24 +0000 (01:51 -0000)]
Actually we dont need to check if the device is nfs as it wont be stat'ed
Glenn L McGrath [Mon, 7 May 2001 01:40:59 +0000 (01:40 -0000)]
woops, i shouldnt be so presumtuous? about what the error will be
Glenn L McGrath [Mon, 7 May 2001 01:38:03 +0000 (01:38 -0000)]
Device may not be a real filename
Matt Kraai [Sat, 5 May 2001 16:19:13 +0000 (16:19 -0000)]
Rewrite -c and -b processing to shrink code and eliminate buffer overrun.
Glenn L McGrath [Sat, 5 May 2001 03:19:12 +0000 (03:19 -0000)]
include libbb.h after other includes
Eric Andersen [Fri, 4 May 2001 22:13:37 +0000 (22:13 -0000)]
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 [Fri, 4 May 2001 22:04:24 +0000 (22:04 -0000)]
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
Mark Whitley [Fri, 4 May 2001 21:46:00 +0000 (21:46 -0000)]
Wrote documentation and scripts for creating a busybox boot floppy. Initial revision.
Matt Kraai [Fri, 4 May 2001 21:20:20 +0000 (21:20 -0000)]
Don't reset parents context when we encounter an terminator. Fixes
if true; then if true; then true; fi; fi
Eric Andersen [Fri, 4 May 2001 20:47:33 +0000 (20:47 -0000)]
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 [Fri, 4 May 2001 16:30:29 +0000 (16:30 -0000)]
If it fails to run a builtin, let it fall through to
exec the real thing.
-Erik
Matt Kraai [Fri, 4 May 2001 14:49:58 +0000 (14:49 -0000)]
Fix two bugs reported by Ralph Jones.
Eric Andersen [Thu, 3 May 2001 17:35:48 +0000 (17:35 -0000)]
A todo update from larry to acknowledge the existance of hush
Eric Andersen [Thu, 3 May 2001 07:01:41 +0000 (07:01 -0000)]
devfs does not support creation of regular files. So change the
test a bit so as to not possibly create a regular file.
-Erik
Matt Kraai [Thu, 3 May 2001 04:45:40 +0000 (04:45 -0000)]
Remove summary header. Not present in GNU or SUSv2.
Matt Kraai [Wed, 2 May 2001 21:48:17 +0000 (21:48 -0000)]
Move up waitpid error check so that errno isn't clobbered by tcsetpgrp.
Matt Kraai [Wed, 2 May 2001 21:24:51 +0000 (21:24 -0000)]
Canonicalize path before trying to unmount it.
Matt Kraai [Wed, 2 May 2001 21:17:38 +0000 (21:17 -0000)]
Fix bug #1108 by always canonicalizing arguments.
Eric Andersen [Wed, 2 May 2001 20:12:03 +0000 (20:12 -0000)]
Some more job control updates. It will now sucessfully background
stuff. Good luck getting things back into the foreground though...
-Erik
Matt Kraai [Wed, 2 May 2001 17:52:49 +0000 (17:52 -0000)]
Don't treat newline as pipe separator when processing substitutions.
Eric Andersen [Wed, 2 May 2001 17:19:25 +0000 (17:19 -0000)]
Use .png for images (removing all .gifs) and make them all 90x36
-Erik
Matt Kraai [Wed, 2 May 2001 16:26:12 +0000 (16:26 -0000)]
Fix $(...) construction. Noted and patched by Larry Doolittle
<ldoolitt@recycle.lbl.gov>. I'm just a patch whore. :)
Eric Andersen [Wed, 2 May 2001 16:11:59 +0000 (16:11 -0000)]
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
Matt Kraai [Wed, 2 May 2001 15:37:09 +0000 (15:37 -0000)]
Use the current pgrp, not pid, when resetting the foreground process group.
Fixes bizarre suspension when executing `echo`.
Matt Kraai [Wed, 2 May 2001 14:48:48 +0000 (14:48 -0000)]
Don't segfault if the first word is the empty string.
Eric Andersen [Wed, 2 May 2001 02:09:36 +0000 (02:09 -0000)]
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.
Matt Kraai [Tue, 1 May 2001 21:12:31 +0000 (21:12 -0000)]
Skip headers with empty filenames, rather than stopping.
Eric Andersen [Tue, 1 May 2001 16:24:32 +0000 (16:24 -0000)]
Another refinement, this time from Larry.
Eric Andersen [Tue, 1 May 2001 14:54:35 +0000 (14:54 -0000)]
Argh. Now we break non-pristine builds. Check a bit more carefully.
-Erik
Eric Andersen [Tue, 1 May 2001 14:37:03 +0000 (14:37 -0000)]
Oops. The dangers of applying patches by hand...
Eric Andersen [Tue, 1 May 2001 01:49:50 +0000 (01:49 -0000)]
Another hush update from Larry:
Minor improvements. Something is still broken with running
scripts via "hush filename". All the following are now handled
acceptably (matches ash, not bash).
if true; then echo foo1; fi
if
true; then echo foo2; fi
if true; false; then echo bar; else echo foo3; fi
if true || false; then echo foo4; fi
- Larry
Eric Andersen [Tue, 1 May 2001 01:40:34 +0000 (01:40 -0000)]
A patch from Larry to fix pristine source builds (again).
I just can't seem to _not_ break it. Sigh.
Eric Andersen [Mon, 30 Apr 2001 18:18:45 +0000 (18:18 -0000)]
Some more hush.c updates from Larry Doolittle.
Eric Andersen [Mon, 30 Apr 2001 18:18:02 +0000 (18:18 -0000)]
Oops. I was a bit too hasty and also changed applet_name.
Mark Whitley [Mon, 30 Apr 2001 18:17:00 +0000 (18:17 -0000)]
Made new xreadlink function for libbb and changed applets to use it instead of
readlink(2).
Eric Andersen [Mon, 30 Apr 2001 18:08:03 +0000 (18:08 -0000)]
These messages can be .rodata, so make them even more const.
-Erik