Eric Andersen [Fri, 21 Jul 2000 17:22:19 +0000 (17:22 -0000)]
Add in the LinuxMagic VPN Firewall
-Erik
Pavel Roskin [Fri, 21 Jul 2000 15:10:57 +0000 (15:10 -0000)]
Fixed usage info for "cut"
Mark Whitley [Thu, 20 Jul 2000 23:54:42 +0000 (23:54 -0000)]
Took -V out of the sed_usage string.
Eric Andersen [Thu, 20 Jul 2000 23:41:24 +0000 (23:41 -0000)]
* syslogd can now log messages to a remote host -- patch thanks
to Gyepi Sam <gyepi@praxis-sw.com>
-Erik
Mark Whitley [Thu, 20 Jul 2000 23:08:40 +0000 (23:08 -0000)]
As per a discussion on the mailing list between Matt and Pavel. I have removed
the -V (version) flag from busybox sed. It is unnecessary because sed is not a
standalone and should therefore be independently reporting a version number.
Moreover, it is extra code that we just don't need.
Mark Whitley [Thu, 20 Jul 2000 23:06:27 +0000 (23:06 -0000)]
Converted option parsing to getopt(). Also added some explanatory comments.
Eric Andersen [Thu, 20 Jul 2000 21:57:11 +0000 (21:57 -0000)]
Adjusted install.sh to use relative symlinks, and to optionally
create hardlinks. Added a makefile target to create hardlinks.
-Erik
Mark Whitley [Thu, 20 Jul 2000 00:08:10 +0000 (00:08 -0000)]
Converted option parsing to using getopt(). Also managed to remove an
extraneous logic loop that existed only for the purpose of the special case of
only one file. I replaced it with a variable to keep track of the number of
files read.
Mark Whitley [Thu, 20 Jul 2000 00:03:38 +0000 (00:03 -0000)]
Whoops. Forgot to #include <getopt.h>.
Mark Whitley [Wed, 19 Jul 2000 19:38:13 +0000 (19:38 -0000)]
Converted option parsing to getopt() and made some minor formatting changes.
Matt Kraai [Wed, 19 Jul 2000 19:24:01 +0000 (19:24 -0000)]
Centralize handling of --help.
Matt Kraai [Wed, 19 Jul 2000 18:20:02 +0000 (18:20 -0000)]
Added some missing declarations and fixed some typos. I have to
remember to compile *before* committing.
Matt Kraai [Wed, 19 Jul 2000 18:01:00 +0000 (18:01 -0000)]
Add usage messages for applets without them.
Eric Andersen [Wed, 19 Jul 2000 17:37:57 +0000 (17:37 -0000)]
Avoid trying to free NULL ptrs. Comment on malloc usages.
-Erik
Eric Andersen [Wed, 19 Jul 2000 17:36:27 +0000 (17:36 -0000)]
Use FatalError()
-Erik
Eric Andersen [Wed, 19 Jul 2000 17:35:54 +0000 (17:35 -0000)]
Moved some code and add a coupld #defines to support use of dmalloc.
-Erik
Eric Andersen [Wed, 19 Jul 2000 17:34:40 +0000 (17:34 -0000)]
Funny. Head was getting installed to the wrong spot.
-Erik
Eric Andersen [Wed, 19 Jul 2000 17:33:54 +0000 (17:33 -0000)]
Updated to add support for dmalloc, and adjusted for better cross
compiler support.
-Erik
Mark Whitley [Tue, 18 Jul 2000 21:02:06 +0000 (21:02 -0000)]
Consolodated some common code into print_matched_line to make 'grep_file' a
little more terse & clean. Also made a few minor formatting changes.
Eric Andersen [Tue, 18 Jul 2000 18:54:08 +0000 (18:54 -0000)]
Removed now incorrect message about NFS not working with
Linux 2.[34].x kernels. It does work now,
-Erik
Mark Whitley [Tue, 18 Jul 2000 18:37:01 +0000 (18:37 -0000)]
Added support for the -c (count matches) option. Made it so it works just like
GNU grep.
Eric Andersen [Tue, 18 Jul 2000 08:16:39 +0000 (08:16 -0000)]
Sigh -- can't sleep. Clean up some mem leaks, fixed some bugs.
-Erik
Pavel Roskin [Mon, 17 Jul 2000 23:45:12 +0000 (23:45 -0000)]
New message added to messages.c: full_version
Used where possible
Pavel Roskin [Mon, 17 Jul 2000 20:18:42 +0000 (20:18 -0000)]
Moved functions used by "lsmod" from cat.c to utility.c
Adjusted to make lsmod and sh compilable as standalone apps.
Comment fixes
Mark Whitley [Mon, 17 Jul 2000 20:06:42 +0000 (20:06 -0000)]
- Added support for backreferences in substitution expressions up to nine
(\1, \2...\9). This touched a lot of places in this file and I added a new
function 'print_subst_w_backrefs' in order to keep 'do_subst_command' a
little more tidy.
* I tested this good 'n hard, but will always appreciate more testing from
other, willing folks.
- Noticed that the index_of_next_unescaped_slash was subtly wrong so I
changed both the functionality and behavior (it used to skip over the first
char in the string you passed it, assuming it was a leading '/'--this
assumption is no longer made) this necessitated changing the lines that
call this function just slightly.
Pavel Roskin [Mon, 17 Jul 2000 19:31:54 +0000 (19:31 -0000)]
Now it's possible to compile Busybox with only one app defined
(unless it's lsmod, to be fixed by the next commit)
Eric Andersen [Mon, 17 Jul 2000 19:14:41 +0000 (19:14 -0000)]
Backtick support to infinite (memory limited) levels of nesting is
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
Pavel Roskin [Mon, 17 Jul 2000 17:52:00 +0000 (17:52 -0000)]
It is now possible to select in busybox.def.h whether minixfs version 2
is to be supported.
Pavel Roskin [Mon, 17 Jul 2000 16:17:19 +0000 (16:17 -0000)]
The result of getopt() is "int" and should be treated as such
Matt Kraai [Sun, 16 Jul 2000 20:57:15 +0000 (20:57 -0000)]
Extract usage information into a separate file.
Matt Kraai [Fri, 14 Jul 2000 23:28:47 +0000 (23:28 -0000)]
Don't use strings directly in calls to usage(). This is in preparation
for their extraction to a separate file.
Mark Whitley [Fri, 14 Jul 2000 23:24:00 +0000 (23:24 -0000)]
Fixed a couple of buglets:
- add_cmd_str: segv's were being generated if there was a '# comment' line
(and probably other kinds of lines, too) that was not followed by a
semi-colon or whitespace
- parse_edit_cmd: was returning a wrong number (too low) for the index; it
was not accounting for backslashes eaten, for the fact that we start at the
3rd index in the string, or for the fact that we add an extra newline.
- parse_cmd_str: was returning a wrong number (again, too low) for the index
in the case of single-letter commands (p,d). There was some
over-compensation for this in the 'return' stmt at the end which also
needed some help.
- load_cmd_file: was not eating trailing newlines off the line read from the
command file. This had the deleterious effect of printing an extra newlines
after text displayed from edit (i,a,c) commands.
Mark Whitley [Fri, 14 Jul 2000 19:06:30 +0000 (19:06 -0000)]
- Added support for semicolon delimited command lines. (woo-hoo!)
- Obsoleted the trim_str function (#if 0'ed out -- maybedelete later) in
favor of strrspn.
- Obsoleted the strrspn function (#if 0'ed out as well) as soon as I
discovered that it wasn't needed either.
- Fixed a subtle bug in parse_subst_cmd where it would choke with an error if
there was any trailing space after the s/match/replace/ expression.
Eric Andersen [Fri, 14 Jul 2000 18:39:08 +0000 (18:39 -0000)]
Getopt'ed by Marc Nijdam <marc_nijdam@hp.com>
-Erik
Eric Andersen [Fri, 14 Jul 2000 18:38:26 +0000 (18:38 -0000)]
Getopt'rd by Marc Nijdam <marc_nijdam@hp.com>
-Erik
Pavel Roskin [Fri, 14 Jul 2000 17:24:58 +0000 (17:24 -0000)]
More fixes for "signed vs. unsigned" warnings.
Pavel Roskin [Fri, 14 Jul 2000 16:23:32 +0000 (16:23 -0000)]
Reduced the number of "signed vs. unsigned" warnings.
Sometimes such warnings matter (esp. on PPC with char default to unsigned)
Pavel Roskin [Fri, 14 Jul 2000 15:55:41 +0000 (15:55 -0000)]
More fixes for "missing initializers"
Pavel Roskin [Fri, 14 Jul 2000 15:44:25 +0000 (15:44 -0000)]
Fixed a warning about missing initializer
Pavel Roskin [Fri, 14 Jul 2000 15:18:57 +0000 (15:18 -0000)]
The result of getopt() should not be converted to "char" - it breaks on PPC
Eric Andersen [Fri, 14 Jul 2000 06:49:52 +0000 (06:49 -0000)]
More cleanups.
-Erik
Matt Kraai [Fri, 14 Jul 2000 06:47:33 +0000 (06:47 -0000)]
Fix argument parsing.
Eric Andersen [Fri, 14 Jul 2000 06:29:10 +0000 (06:29 -0000)]
Be more pedantic aboutthe terminating null applet.
-Erik
Eric Andersen [Fri, 14 Jul 2000 06:27:54 +0000 (06:27 -0000)]
uid and gid were unsigned, but were compared vs signed values (-1)
-Erik
Eric Andersen [Fri, 14 Jul 2000 06:19:41 +0000 (06:19 -0000)]
A couple of minor warning cleanups.
-Erik
Matt Kraai [Fri, 14 Jul 2000 01:51:25 +0000 (01:51 -0000)]
Use errorMsg rather than fprintf.
Eric Andersen [Fri, 14 Jul 2000 01:13:37 +0000 (01:13 -0000)]
Fix some stupid memory bugs.
-Erik
Eric Andersen [Fri, 14 Jul 2000 01:13:11 +0000 (01:13 -0000)]
Add in redimentary backtick suport (doesn't work properly yet, but is
close).
-Erik
Mark Whitley [Fri, 14 Jul 2000 00:49:59 +0000 (00:49 -0000)]
It dawned on me that I would need to grow a char buffer one extra char bigger
to accomodate a trailing '\n'ewline that I append to it later one. This is
only necessary for the case of one inserted, appended, or changed line, but
it's still necessary.
Mark Whitley [Fri, 14 Jul 2000 00:13:52 +0000 (00:13 -0000)]
Added error checking for edit commands; only a beginning address can be
specified.
Mark Whitley [Fri, 14 Jul 2000 00:00:15 +0000 (00:00 -0000)]
Added support for (a)ppend, (i)nsert, and (c)hange commands to sed.
Mark Whitley [Thu, 13 Jul 2000 22:52:02 +0000 (22:52 -0000)]
Fixed bug where sed '/foo/p' was printing "invalid command".
Mark Whitley [Thu, 13 Jul 2000 20:01:58 +0000 (20:01 -0000)]
(Something I should have done in the previous checkin...) Also broke out
substitution command execution from do_sed_command() and put it in it's own
do_subst_command() function.
Mark Whitley [Thu, 13 Jul 2000 19:58:04 +0000 (19:58 -0000)]
Minor code reorg: Changed the interface to index_of_next_unescaped_slash to an
interface that seems a little more sensible to me. Also broke out s///
expression parsing into it's own subroutine.
Eric Andersen [Thu, 13 Jul 2000 19:49:12 +0000 (19:49 -0000)]
Fix uninitialized variable.
-Erik
Eric Andersen [Thu, 13 Jul 2000 18:42:58 +0000 (18:42 -0000)]
Patch from Marc Nijdam <marc_nijdam@hp.com>
> First (of many more) patch of cp_mv to getopt use. I'm using the most
> simplistic approach, just get getopt used, then worry about a cleaner
> option parsing style using getopt later.
>
> Marc
Mark Whitley [Thu, 13 Jul 2000 17:20:23 +0000 (17:20 -0000)]
Added a smallish TODO comment.
Eric Andersen [Thu, 13 Jul 2000 16:40:41 +0000 (16:40 -0000)]
From Matt Kraai <kraai@alumni.carnegiemellon.edu>
> Here is a patch so that tr can handle NULL characters as well. Give it
> a shot and let me know what you think. It is against the latest CVS
> version.
>
> In my tests, the following now works as expected.
>
> tr '\0' '\n'
>
> Later,
> Matt
Matt Kraai [Thu, 13 Jul 2000 06:33:12 +0000 (06:33 -0000)]
Correct argument parsing and other minor cleanups.
Mark Whitley [Wed, 12 Jul 2000 23:36:17 +0000 (23:36 -0000)]
Added some smallish comments to help folks understand why we have two tables
of builtins and the reasoning behind it.
Mark Whitley [Wed, 12 Jul 2000 23:35:21 +0000 (23:35 -0000)]
Changed bb_regcomp to xregcomp and #if 0'ed out destroy_cmd_strs in sed.c
(maybe I'll remove it later).
Eric Andersen [Wed, 12 Jul 2000 23:01:04 +0000 (23:01 -0000)]
Patch from Jon McClintock <jonm@bluemug.com>
>The attached patch adds the ability to parse the actual mode specifier in
>fbset. So now
>
> fbset -n 640x480-72
>
>Will actually work. I don't know if I've reinvented the wheel though...
-Erik
Matt Kraai [Wed, 12 Jul 2000 17:02:35 +0000 (17:02 -0000)]
Always report the applet name when doing error reporting.
Matt Kraai [Wed, 12 Jul 2000 15:38:49 +0000 (15:38 -0000)]
Use global applet_name instead of local versions.
Matt Kraai [Wed, 12 Jul 2000 00:53:06 +0000 (00:53 -0000)]
Use global applet_name instead of local versions.
Matt Kraai [Wed, 12 Jul 2000 00:43:28 +0000 (00:43 -0000)]
The applet name isn't constant.
Eric Andersen [Tue, 11 Jul 2000 23:06:48 +0000 (23:06 -0000)]
Changed verbiage.
-Erik
Eric Andersen [Tue, 11 Jul 2000 23:05:38 +0000 (23:05 -0000)]
Replaced projects with products/projects.
-Erik
Eric Andersen [Tue, 11 Jul 2000 23:03:40 +0000 (23:03 -0000)]
Added the Kerbango Internet Radio to projects/products using BusyBox.
-Erik
Mark Whitley [Tue, 11 Jul 2000 21:38:47 +0000 (21:38 -0000)]
Applied patch from Matt Kraai to call destroy_cmd_strs in atexit(), rather
than peppering it throughout the code.
Matt Kraai [Tue, 11 Jul 2000 20:03:24 +0000 (20:03 -0000)]
Added applet_name to contain the applet name.
Eric Andersen [Tue, 11 Jul 2000 18:18:40 +0000 (18:18 -0000)]
Final updates for release.
-Erik
Eric Andersen [Tue, 11 Jul 2000 18:06:01 +0000 (18:06 -0000)]
Final update for the release.
Eric Andersen [Tue, 11 Jul 2000 17:52:22 +0000 (17:52 -0000)]
Forgot to commit these cleanups it seems.
-Erik
Eric Andersen [Tue, 11 Jul 2000 17:45:42 +0000 (17:45 -0000)]
More changelog updates
-Erik
Mark Whitley [Tue, 11 Jul 2000 17:43:42 +0000 (17:43 -0000)]
Added changelog entries for grep/sed/regex changes.
Eric Andersen [Tue, 11 Jul 2000 17:42:56 +0000 (17:42 -0000)]
Some changelog updates.
-Erik
Eric Andersen [Tue, 11 Jul 2000 17:38:27 +0000 (17:38 -0000)]
Re-enable ln -n in the help.
-Erik
Eric Andersen [Tue, 11 Jul 2000 17:35:32 +0000 (17:35 -0000)]
Another patch from Matt Kraai <kraai@alumni.carnegiemellon.edu>:
>
> The following patch allows ln -n to function like GNU. It also fixes a
> typo with my previous patch to add support for ln FILE DIRECTORY. And
> it removes some code that checks the maximum length of the filenames. I
> can't figure out why that code is necessary. Anyone know?
>
> Matt
Eric Andersen [Tue, 11 Jul 2000 17:29:36 +0000 (17:29 -0000)]
Added 'dumpkmap' to allow people to dump a binary keymap, which can then be
loaded in by 'loadkmap' -- submitted by Arne Bernin <arne@matrix.loopback.org>
-Erik
Mark Whitley [Tue, 11 Jul 2000 16:53:56 +0000 (16:53 -0000)]
Applied patch from Matt Kraai which does the following:
- adds case-insensitive matching in sed s/// epxressions
- consolodates common regcomp code in grep & sed into bb_regcomp and put in
utility.c
- cleans up a bunch of cruft
Matt Kraai [Tue, 11 Jul 2000 16:09:01 +0000 (16:09 -0000)]
Fix dead link.
-Matt
Eric Andersen [Mon, 10 Jul 2000 23:39:44 +0000 (23:39 -0000)]
Fixed NFS so it supports 2.4.x kernels and NFSv3. Should close bug #1009.
-Erik
Mark Whitley [Mon, 10 Jul 2000 23:07:54 +0000 (23:07 -0000)]
Removed all trace of hand-tooled regexp routines. Bye bye, baby.
Mark Whitley [Mon, 10 Jul 2000 23:00:47 +0000 (23:00 -0000)]
Added a rule to make tags files for vi(m).
Eric Andersen [Mon, 10 Jul 2000 22:57:14 +0000 (22:57 -0000)]
Comment on kernel stuff
-Erik
Mark Whitley [Mon, 10 Jul 2000 22:55:51 +0000 (22:55 -0000)]
Brand, new sed that uses libc regex routines.
There is some common code used by both sed & grep that should be put into
utility.c as per Mat Kraai's suggestions/patch on the mailing list.
Specifically, a common regex_compile() and a regex_subst() function need to be
made.
Eric Andersen [Mon, 10 Jul 2000 22:46:55 +0000 (22:46 -0000)]
More linux kernel header file removal.
-Erik
Eric Andersen [Mon, 10 Jul 2000 20:08:44 +0000 (20:08 -0000)]
Remove yet more kernel header dependancies.
-Erik
Eric Andersen [Mon, 10 Jul 2000 20:08:09 +0000 (20:08 -0000)]
Remove unused variable.
-Erik
Eric Andersen [Mon, 10 Jul 2000 19:56:47 +0000 (19:56 -0000)]
Remove the problematic CTRLCHAR macro.
-Erik
Mark Whitley [Mon, 10 Jul 2000 19:31:31 +0000 (19:31 -0000)]
Put the GROWBY variable inside the get_line_from_file function, as that is the
only function where it's used and it's always good to keep the namespace
clean. :-)
Mark Whitley [Mon, 10 Jul 2000 19:29:09 +0000 (19:29 -0000)]
Removed unnecessary #include "regexp.h" line from find.c as per Matt Kraai's
suggestion on the mailing list.
Eric Andersen [Mon, 10 Jul 2000 18:47:24 +0000 (18:47 -0000)]
Function name cleanup.
-Erik
Eric Andersen [Mon, 10 Jul 2000 16:44:03 +0000 (16:44 -0000)]
From Matt Kraai <kraai@alumni.carnegiemellon.edu>:
Howdy,
Bug #1006 reports that
ln -s /tmp/foo .
does not work correctly. In fact, it appears that any instantiation of
ln -s FILE... DIRECTORY
does not work. The following patch adds support for this form, which
then fixes the particular instance noted in the bug report.
In the process, I needed the basename function. This appears in the
string.h provided by glibc, but not uC-libc. So I wrote my own to go in
utility.c, called get_last_path_component. I also modified the basename
utility to use this function.
At some point it might be desirous to use the basename from the library
if it exists, and otherwise compile our own. But I don't know how to do
this.
Matt
Eric Andersen [Mon, 10 Jul 2000 16:38:50 +0000 (16:38 -0000)]
Patch from Matt Kraai <kraai@alumni.carnegiemellon.edu>:
GNU tr complains on the following:
$ tr a ''
tr: when not truncating set1, string2 must be non-empty
BusyBox tr does not complain:
$ tr a ''
a
^D
0
It should result in an error, not in some spurious output. The attached
patch generates an error.
Matt
Mark Whitley [Mon, 10 Jul 2000 15:50:26 +0000 (15:50 -0000)]
Applied patch from Matt Kraai as per his email:
However, the case of
grep foo$ file
didn't work, due to a problem with the flags used in regular expression
compilation. The attached patch fixes this problem.
---patch-------
Index: grep.c
===================================================================
RCS file: /var/cvs/busybox/grep.c,v
retrieving revision 1.30
diff -u -r1.30 grep.c
--- grep.c 2000/07/04 22:17:01 1.30
+++ grep.c 2000/07/10 08:57:04
@@ -141,8 +141,10 @@
if (argv[optind] == NULL)
usage(grep_usage);
- /* compile the regular expression */
- reflags = REG_NOSUB; /* we're not going to mess with sub-expressions
*/
+ /* compile the regular expression
+ * we're not going to mess with sub-expressions, and we need to
+ * treat newlines right. */
+ reflags = REG_NOSUB | REG_NEWLINE;
if (ignore_case)
reflags |= REG_ICASE;
if ((ret = regcomp(®ex, argv[optind], reflags)) != 0) {
---patch-------
Thanks, Matt, it works great.
Eric Andersen [Sun, 9 Jul 2000 06:59:58 +0000 (06:59 -0000)]
More portability updates. Now compiles cleanly vs glibc, libc5, and uclibc
(except for mkfs_minix and fsck_minix -- and it doesn't yet link vs uclibc due
to missing stuff in the library).
-Erik
Eric Andersen [Sun, 9 Jul 2000 05:56:14 +0000 (05:56 -0000)]
include getopt.h
-Erik
Eric Andersen [Sun, 9 Jul 2000 02:38:01 +0000 (02:38 -0000)]
Fix a bug in get_line_from_file. If the length of the line is (GROWBY * n) +
GROWBY - 1, then it writes the null character just after the buffer. Yipe.
Fix thanks to Matt Kraai <kraai@alumni.carnegiemellon.edu> Thanks Matt!
-Erik