Compare commits

..
26 Commits
Author SHA1 Message Date
Eric Andersen d3986eb7ec When doing 'make release' nuke the .svn directories, not the
CVS dirs (since they are no longer present)
2005-08-17 00:01:38 +00:00
Eric Andersen 9e78a1772d We don't need no stinkin changelog 2005-08-16 23:59:17 +00:00
Mike Frysinger f7c7dde158 Bernhard Fischer writes: fix devfsd usage 2005-08-15 22:13:21 +00:00
Rob Landley 830c040f6f Patch from Stephane Billiart to improve ash error message. 2005-08-14 19:17:31 +00:00
Rob Landley 045dedad91 A complete rewrite of the README. Probably broke stuff, but it's unlikely
to affect the compile, now is it?
2005-08-14 00:19:32 +00:00
Rob Landley b309ec71c8 Delete the patches directory from 1.0. 2005-08-13 04:05:50 +00:00
Rob Landley 866bad310f And 10922.
Ick.
2005-08-13 03:10:29 +00:00
Rob Landley 5e1f2d429d 11043 and 11011 2005-08-13 02:28:34 +00:00
Rob Landley 0be69b1693 More backports:
10957 start-stop-daemon -q
10981, 10982, 10994, 10996, 10997: dumpkmap cleanup
10983: top tweak
11000 traceroute
2005-08-13 01:22:03 +00:00
Rob Landley c7cba1ae3b This is published from trunk, remove from 1.0 branch. 2005-08-13 01:12:49 +00:00
Rob Landley be3dae145f Makefile related backports:
10945, 10946 Make compile much, much faster.
10923 big makefile change.  Nervous.
10946, 10991, 10998, 11003 small makefile fixes.
2005-08-13 01:10:27 +00:00
Rob Landley 6022fc8723 Backport:
10882 tar fix
10884, 10920, 11128 tail fixes
10885 tftp -g fix
10900 dpkg fix (script support)
And I guess 10918 isn't relevant?
2005-08-13 00:46:00 +00:00
Rob Landley fc455b2101 1.0 backports of:
10861, 10875, 10881, 10888 ash fix
10865 suid thing?  (look at this)
10886 telnet bugfix
10866 ftp fix for RFC 959 compliance.
10867 Remove spurious newline from cp -i prompt.
10874 ksyslogd fix
10876 msh fix
10877 httpd fix
10880, 10889, 11005 dhcp fixes
2005-08-13 00:26:01 +00:00
Rob Landley 365a345e92 Backport 10864 and 10999. 2005-08-12 06:08:41 +00:00
Rob Landley d5138f44fe Backport 10853, 10860/10870, and 10862. 2005-08-12 06:06:54 +00:00
Rob Landley 9344d8aa10 And 10873. 2005-08-12 06:02:30 +00:00
Eric Andersen 44dbd4bc65 Do not define 'AUTOCONF_INCLUDED' 2005-08-02 01:00:20 +00:00
Mike Frysinger 25b8652b4f patch by srowe in Bug 359 to fix fgrep aliasing 2005-07-31 22:41:05 +00:00
Eric Andersen 091a3e510e The change in getty.c in Busybox 1.01 caused the /etc/issue file to not
be displayed unless CONFIG_FEATURE_UTMP is set.  This was not the intended
result.
2005-07-27 06:03:24 +00:00
Mike Frysinger ffaa3deeeb no longer used as reported by apgo in Bug 348 2005-07-26 22:53:35 +00:00
Rob Landley 5f07779aca Shaun Jackman points out that we shouldn't depend on netdb.h to include
netinet.h for us, although what strange compiler this is expected to 
cause problems with wasn't specified...
2005-07-25 08:09:51 +00:00
Rob Landley ab6399a4c6 Tweak from Sean Jackman: use socklen_t instead of size_t for a declaration. 2005-07-25 01:46:24 +00:00
Eric Andersen ca17c937c2 Bump the version to 1.01 2005-07-19 00:01:10 +00:00
Eric Andersen d62df011a0 Backport 10849 and 10851 2005-07-18 23:54:47 +00:00
Eric Andersen 164a716f96 busybox-1.0.1-rc1.patch
http://busybox.net/lists/busybox/2005-July/014974.html
2005-07-18 23:51:27 +00:00
nobody 8c59a0bf0e This commit was manufactured by cvs2svn to create tag 'busybox_1_00'. 2004-10-13 09:42:10 +00:00
789 changed files with 1961 additions and 8020 deletions

No files matched your search

-7
View File
@@ -1,7 +0,0 @@
busybox
busybox.links
_install
.config
.menuconfig.log
.config.cmd
.config.old
-1381
View File
File diff suppressed because it is too large. Load diff
-127
View File
@@ -1,127 +0,0 @@
Please see the LICENSE file for details on copying and usage.
BusyBox combines tiny versions of many common UNIX utilities into a single
small executable. It provides minimalist replacements for most of the utilities
you usually find in GNU coreutils, util-linux, etc. The utilities in BusyBox
generally have fewer options than their full-featured GNU cousins; however, the
options that are included provide the expected functionality and behave very
much like their GNU counterparts.
BusyBox has been written with size-optimization and limited resources in mind.
It is also extremely modular so you can easily include or exclude commands (or
features) at compile time. This makes it easy to customize your embedded
systems. To create a working system, just add /dev, /etc, and a Linux kernel.
BusyBox provides a fairly complete POSIX environment for any small or embedded
system.
BusyBox is extremely configurable. This allows you to include only the
components you need, thereby reducing binary size. Run 'make config' or
'make menuconfig' to select the functionality that you wish to enable.
After the build is complete, a busybox.links file is generated. This is
used by 'make install' to create symlinks to the BusyBox binary for all
compiled in functions. By default, 'make install' will place the symlink
forest into `pwd`/_install unless you have defined the PREFIX environment
variable (i.e., 'make PREFIX=/tmp/foo install')
If you wish to install hard links, rather than symlinks, you can use
'make PREFIX=/tmp/foo install-hardlinks' instead.
----------------
Supported architectures:
BusyBox in general will build on any architecture supported by gcc.
Kernel module loading for 2.2 and 2.4 Linux kernels is currently
limited to ARM, CRIS, H8/300, x86, ia64, x86_64, m68k, MIPS, PowerPC,
S390, SH3/4/5, Sparc, v850e, and x86_64 for 2.4.x kernels. For 2.6.x
kernels, kernel module loading support should work on all architectures.
Supported C Libraries:
uClibc and glibc are supported. People have been looking at newlib and
dietlibc, but they are currently considered unsupported, untested, or
worse. Linux-libc5 is no longer supported -- you should probably use uClibc
instead if you want a small C library.
Supported kernels:
Full functionality requires Linux 2.2.x or better. A large fraction of the
code should run on just about anything. While the current code is fairly
Linux specific, it should be fairly easy to port the majority of the code
to support, say, FreeBSD or Solaris, or Mac OS X, or even Windows (if you
are into that sort of thing).
----------------
Getting help:
When you find you need help, you can check out the BusyBox mailing list
archives at http://busybox.net/lists/busybox/ or even join
the mailing list if you are interested.
----------------
Bugs:
If you find bugs, please submit a detailed bug report to the BusyBox mailing
list at busybox@mail.busybox.net. A well-written bug report should include a
transcript of a shell session that demonstrates the bad behavior and enables
anyone else to duplicate the bug on their own machine. The following is such
an example:
To: busybox@mail.busybox.net
From: diligent@testing.linux.org
Subject: /bin/date doesn't work
Package: BusyBox
Version: 1.00
When I execute BusyBox 'date' it produces unexpected results.
With GNU date I get the following output:
$ date
Fri Oct 8 14:19:41 MDT 2004
But when I use BusyBox date I get this instead:
$ date
illegal instruction
I am using Debian unstable, kernel version 2.4.25-vrs2 on a Netwinder,
and the latest uClibc from CVS. Thanks for the wonderful program!
-Diligent
Note the careful description and use of examples showing not only what BusyBox
does, but also a counter example showing what an equivalent GNU app does. Bug
reports lacking such detail may never be fixed... Thanks for understanding.
----------------
Downloads:
Source for the latest released version, as well as daily snapshots, can always
be downloaded from
http://busybox.net/downloads/
----------------
CVS:
BusyBox now has its own publicly browsable CVS tree at:
http://busybox.net/cgi-bin/cvsweb/busybox/
Anonymous CVS access is available. For instructions, check out:
http://busybox.net/cvs_anon.html
For those that are actively contributing there is even CVS write access:
http://busybox.net/cvs_write.html
----------------
Please feed suggestions, bug reports, insults, and bribes back to:
Erik Andersen
<andersen@codepoet.org>
View File
File renamed without changes.
+12 -4
View File
@@ -2,7 +2,7 @@ List of the authors of code contained in BusyBox.
If you have code in BusyBox, you should be listed here. If you should be
listed, or the description of what you have done needs more detail, or is
incorect, _please_ let me know.
incorrect, _please_ let me know.
-Erik
@@ -23,6 +23,9 @@ Laurence Anderson <l.d.anderson@warwick.ac.uk>
Jeff Angielski <jeff@theptrgroup.com>
ftpput, ftpget
Jim Bauer <jfbauer@nfr.com>
modprobe shell dependency
Edward Betts <edward@debian.org>
expr, hostid, logname, whoami
@@ -69,6 +72,11 @@ Daniel Jacobowitz <dan@debian.org>
Matt Kraai <kraai@alumni.cmu.edu>
documentation, bugfixes, test suite
Rob Landley <rob@landley.net>
sed (major rewrite in 2003, and I now maintain the thing).
bunzip2 (complete from-scratch rewrite, then mjn3 optimized the result.)
I've patched lots of other applets, but don't maintain 'em.
Stephan Linz <linz@li-pro.net>
ipcalc, Red Hat equivalence
@@ -76,9 +84,9 @@ John Lombardo <john@deltanet.com>
tr
Glenn McGrath <bug1@iinet.net.au>
Common unarchving code and unarchiving applets, ifupdown, ftpgetput,
nameif, sed, patch, fold, install, uudecode.
Various bugfixes, review and apply numerous patches.
Common unarchiving code and unarchiving applets, ifupdown, ftpgetput,
nameif, sed, patch, fold, install, uudecode.
Various bugfixes, review and apply numerous patches.
Manuel Novoa III <mjn3@codepoet.org>
cat, head, mkfifo, mknod, rmdir, sleep, tee, tty, uniq, usleep, wc, yes,
View File
File renamed without changes.
View File
File renamed without changes.
+25 -26
View File
@@ -22,7 +22,7 @@
#--------------------------------------------------------------
noconfig_targets := menuconfig config oldconfig randconfig \
defconfig allyesconfig allnoconfig clean distclean \
release tags
release tags
ifndef TOPDIR
TOPDIR=$(CURDIR)/
@@ -34,7 +34,7 @@ ifndef top_builddir
top_builddir=$(CURDIR)
endif
srctree=$(top_srcdir)
export srctree=$(top_srcdir)
vpath %/Config.in $(srctree)
include $(top_builddir)/Rules.mak
@@ -147,7 +147,7 @@ uninstall: busybox.links
rm -f $(PREFIX)/bin/busybox
for i in `cat busybox.links` ; do rm -f $(PREFIX)$$i; done
install-hardlinks: applets/install.sh busybox busybox.links
install-hardlinks: $(top_srcdir)/applets/install.sh busybox busybox.links
$(SHELL) $< $(PREFIX) --hardlinks
check: busybox
@@ -164,9 +164,9 @@ docs/busybox.pod : $(top_srcdir)/docs/busybox_header.pod $(top_srcdir)/include/u
cat $(top_srcdir)/docs/busybox_footer.pod ) > docs/busybox.pod
docs/BusyBox.txt: docs/busybox.pod
@echo
@echo BusyBox Documentation
@echo
$(SECHO)
$(SECHO) BusyBox Documentation
$(SECHO)
-mkdir -p docs
-pod2text $< > $@
@@ -193,7 +193,7 @@ scripts/mkdep: $(top_srcdir)/scripts/mkdep.c
scripts/split-include: $(top_srcdir)/scripts/split-include.c
$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
.depend: scripts/mkdep
.depend: scripts/mkdep include/config.h
rm -f .depend .hdepend;
mkdir -p include/config;
scripts/mkdep -I include -- \
@@ -201,7 +201,7 @@ scripts/split-include: $(top_srcdir)/scripts/split-include.c
scripts/mkdep -I include -- \
`find $(top_srcdir) -name \*.h -print | sed -e "s,^./,,"` >> .hdepend;
depend dep: include/config.h .depend
depend dep: .depend
include/config/MARKER: depend scripts/split-include
scripts/split-include include/config.h include/config
@@ -214,9 +214,9 @@ include/config.h: .config
@$(top_builddir)/scripts/config/conf -o $(CONFIG_CONFIG_IN)
finished2:
@echo
@echo Finished installing...
@echo
$(SECHO)
$(SECHO) Finished installing...
$(SECHO)
else # ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
@@ -286,20 +286,20 @@ distclean: clean
- $(MAKE) -C scripts/config clean
release: distclean #doc
cd ..; \
rm -rf $(PROG)-$(VERSION); \
cp -a busybox $(PROG)-$(VERSION); \
\
find $(PROG)-$(VERSION)/ -type d \
-name CVS \
-print \
-exec rm -rf {} \; ; \
\
find $(PROG)-$(VERSION)/ -type f \
-name .\#* \
-print \
-exec rm -f {} \; ; \
\
cd ..; \
rm -rf $(PROG)-$(VERSION); \
cp -a busybox $(PROG)-$(VERSION); \
\
find $(PROG)-$(VERSION)/ -type d \
-name .svn \
-print \
-exec rm -rf {} \; ; \
\
find $(PROG)-$(VERSION)/ -type f \
-name .\#* \
-print \
-exec rm -f {} \; ; \
\
tar -cvzf $(PROG)-$(VERSION).tar.gz $(PROG)-$(VERSION)/;
tags:
@@ -312,4 +312,3 @@ endif # ifeq ($(skip-makefile),)
.PHONY: dummy subdirs release distclean clean config oldconfig \
menuconfig tags check test depend buildtree
+196
View File
@@ -0,0 +1,196 @@
Please see the LICENSE file for details on copying and usage.
What is busybox:
BusyBox combines tiny versions of many common UNIX utilities into a single
small executable. It provides minimalist replacements for most of the
utilities you usually find in bzip2, coreutils, file, findutils, gawk, grep,
inetutils, modutils, net-tools, procps, sed, shadow, sysklogd, sysvinit, tar,
util-linux, and vim. The utilities in BusyBox often have fewer options than
their full-featured cousins; however, the options that are included provide
the expected functionality and behave very much like their larger
counterparts.
BusyBox has been written with size-optimization and limited resources in
mind, both to produce small binaries and to reduce run-time memory usage.
Busybox is also extremely modular so you can easily include or exclude
commands (or features) at compile time. This makes it easy to customize
embedded systems; to create a working system, just add /dev, /etc, and a
Linux kernel. Busybox (usually together with uClibc) has also been used as
a component of "thin client" desktop systems, live-CD distributions, rescue
disks, installers, and so on.
BusyBox provides a fairly complete POSIX environment for any small system,
both embedded environments and more full featured systems concerned about
space. Busybox is slowly working towards implementing the full Single Unix
Specification V3 (http://www.opengroup.org/onlinepubs/009695399/), but isn't
there yet (and for size reasons will probably support at most UTF-8 for
internationalization). We are also interested in passing the Linux Test
Project (http://ltp.sourceforge.net).
----------------
Using busybox:
BusyBox is extremely configurable. This allows you to include only the
components and options you need, thereby reducing binary size. Run 'make
config' or 'make menuconfig' to select the functionality that you wish to
enable.
The behavior of busybox is determined by the name it's called under: as
"cp" it behaves like cp, as "sed" it behaves like sed, and so on. Called
as "busybox" it takes the second argument as the name of the applet to
run (I.E. "./busybox ls -l /proc").
The "standalone shell" mode is an easy way to try out busybox; this is a
command shell that calls the builtin applets without needing them to be
installed in the path. (Note that this requires /proc to be mounted, if
testing from a boot floppy or in a chroot environment.)
The build automatically generates a file "busybox.links", which is used by
'make install' to create symlinks to the BusyBox binary for all compiled in
commands. Use the PREFIX environment variable to specify where to install
the busybox binary and symlink forest. (i.e., 'make PREFIX=/tmp/foo install',
or 'make PREFIX=/tmp/foo install-hardlinks' if you prefer hard links.)
----------------
Downloading the current source code:
Source for the latest released version, as well as daily snapshots, can always
be downloaded from
http://busybox.net/downloads/
You can browse the up to the minute source code and change history online
at:
http://www.busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_00_stable/busybox/
Anonymous SVN access is available. For instructions, check out:
http://busybox.net/subversion.html
For those that are actively contributing and would like to check files in,
see:
http://busybox.net/developer.html
The developers also have a bug and patch tracking system
(http://bugs.busybox.net) although posting a bug/patch to the mailing list
is generally a faster way of getting it fixed, and the complete archive of
what happened is the subversion changelog.
----------------
getting help:
when you find you need help, you can check out the busybox mailing list
archives at http://busybox.net/lists/busybox/ or even join
the mailing list if you are interested.
----------------
bugs:
if you find bugs, please submit a detailed bug report to the busybox mailing
list at busybox@busybox.net. a well-written bug report should include a
transcript of a shell session that demonstrates the bad behavior and enables
anyone else to duplicate the bug on their own machine. the following is such
an example:
to: busybox@mail.busybox.net
from: diligent@testing.linux.org
subject: /bin/date doesn't work
package: busybox
version: 1.00
when i execute busybox 'date' it produces unexpected results.
with gnu date i get the following output:
$ date
fri oct 8 14:19:41 mdt 2004
but when i use busybox date i get this instead:
$ date
illegal instruction
i am using debian unstable, kernel version 2.4.25-vrs2 on a netwinder,
and the latest uclibc from cvs. thanks for the wonderful program!
-diligent
note the careful description and use of examples showing not only what
busybox does, but also a counter example showing what an equivalent app
does (or pointing to the text of a relevant standard). Bug reports lacking
such detail may never be fixed... Thanks for understanding.
----------------
Portability:
Busybox is developed and tested on Linux 2.4 and 2.6 kernels, linked
against uClibc (0.9.27 or greater) and glibc (2.2 or greater). In such
an environment, the full set of busybox features should work (and if
anything doesn't we want to know about it so we can fix it). Note that
the 2.6 kernel can be trimmed down considerably with the aid of Matt
Mackall's -tiny work (http://www.selenic.com/tiny-about/).
Since busybox consists of a large number of more or less independent
applets, portability is a question of which features work where. Some
busybox applets (such as cat and rm) are highly portable and likely to work
just about anywhere, while others (such as insmod and losetup) are only
likely to work under fairly recent Linux kernels with recent C libraries.
Earlier versions of Linux and glibc may or may not work, for any given
configuration. Linux 2.2 or earlier should mostly work, but this is no
longer regularly tested and inherently won't support certain features (such
as long files and --bind mounts). The same is true for glibc 2.0 and 2.1,
expect a higher testing and debugging burden using such old infrastructure.
(The busybox developers are not very interested in supporting these older
versions, but can probably be talked into accepting small patches to fix
simple problems.)
Some environments are not recommended. Early versions of uClibc were buggy
and missing many features: upgrade. Linking against libc5 or dietlibc is
not supported and not interesting to the busybox developers. (The first is
obsolete and has no known size or feature advantages over uClibc, the second
has known bugs that its developers have actively refused to fix.) Ancient
Linux kernels (2.0.x and earlier) are similarly uninteresting.
In theory it's possible to use Busybox under other operating systems (such as
MacOS X, Solaris, Cygwin, or the BSD Fork Du Jour). This generally involves
a different kernel and a different C library at the same time. While it
should be possible to port the majority of the code to work in one of
these environments, don't be suprised if it doesn't work out of the box. If
you're into that sort of thing, start small (selecting just a few applets)
and work your way up.
Shaun Jackman has recently (2005) ported busybox to a combination of newlib
and libgloss, and some of his patches have been integrated. This platform
may join glibc/uclibc and Linux as a supported combination with the 1.1
release, but is not supported in 1.0.
Supported hardware:
BusyBox in general will build on any architecture supported by gcc. We
support both 32 and 64 bit platforms, and both big and little endian
systems.
Under 2.4 Linux kernels, kernel module loading was implemented in a
platform-specific manner. Busybox's insmod utility has been reported to
work under ARM, CRIS, H8/300, x86, ia64, x86_64, m68k, MIPS, PowerPC, S390,
SH3/4/5, Sparc, v850e, and x86_64. Anything else probably won't work.
The module loading mechanism for the 2.6 kernel is much more generic, and
we believe 2.6.x kernel module loading support should work on all
architectures supported by the kernel.
----------------
Please feed suggestions, bug reports, insults, and bribes back to the busybox
maintainer:
Erik Andersen
<andersen@codepoet.org>
+15 -11
View File
@@ -19,7 +19,7 @@
#--------------------------------------------------------
PROG := busybox
VERSION := 1.00
VERSION := 1.01
BUILDTIME := $(shell TZ=UTC date -u "+%Y.%m.%d-%H:%M%z")
@@ -81,12 +81,12 @@ BB_SRC_DIR=
WARNINGS=-Wall -Wstrict-prototypes -Wshadow
CFLAGS=-I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir)
ARFLAGS=-r
ARFLAGS=cru
#--------------------------------------------------------
export VERSION BUILDTIME TOPDIR HOSTCC HOSTCFLAGS CROSS CC AR AS LD NM STRIP CPP
ifeq ($(strip $(TARGET_ARCH)),)
TARGET_ARCH=$(shell $(CC) -dumpmachine | sed -e s'/-.*//' \
TARGET_ARCH:=$(shell $(CC) -dumpmachine | sed -e s'/-.*//' \
-e 's/i.86/i386/' \
-e 's/sparc.*/sparc/' \
-e 's/arm.*/arm/g' \
@@ -109,14 +109,22 @@ endif
check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \
then echo "$(1)"; else echo "$(2)"; fi)
# Setup some shortcuts so that silent mode is silent like it should be
ifeq ($(subst s,,$(MAKEFLAGS)),$(MAKEFLAGS))
export MAKE_IS_SILENT=n
SECHO=@echo
else
export MAKE_IS_SILENT=y
SECHO=-@false
endif
#--------------------------------------------------------
# Arch specific compiler optimization stuff should go here.
# Unless you want to override the defaults, do not set anything
# for OPTIMIZATION...
# use '-Os' optimization if available, else use -O2
OPTIMIZATION=
OPTIMIZATION=${call check_gcc,-Os,-O2}
OPTIMIZATION:=${call check_gcc,-Os,-O2}
# Some nice architecture specific optimizations
ifeq ($(strip $(TARGET_ARCH)),arm)
@@ -158,8 +166,8 @@ ifeq ($(strip $(CONFIG_DEBUG)),y)
STRIPCMD:=/bin/true -Not_stripping_since_we_are_debugging
else
CFLAGS+=$(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG
LDFLAGS += -s -Wl,-warn-common
STRIPCMD:=$(STRIP) --remove-section=.note --remove-section=.comment
LDFLAGS += -Wl,-warn-common
STRIPCMD:=$(STRIP) -s --remove-section=.note --remove-section=.comment
endif
ifeq ($(strip $(CONFIG_STATIC)),y)
LDFLAGS += --static
@@ -190,7 +198,3 @@ endif
CFLAGS += $(CFLAGS_EXTRA)
.PHONY: dummy
.EXPORT_ALL_VARIABLES:
View File
File renamed without changes.
File renamed without changes.
@@ -29,7 +29,7 @@ APPLET_OBJ:= $(patsubst %.c,$(APPLETS_DIR)%.o, $(APPLET_SRC))
libraries-y+=$(APPLETS_DIR)$(APPLETS_AR)
$(APPLETS_DIR)$(APPLETS_AR): $(APPLET_OBJ)
$(AR) -ro $@ $(APPLET_OBJ)
$(AR) $(ARFLAGS) $@ $(APPLET_OBJ)
$(APPLET_OBJ): $(top_builddir)/.config
$(APPLET_OBJ): $(APPLETS_DIR)%.o: $(srcdir)/%.c
File renamed without changes.
+12 -12
View File
@@ -144,25 +144,25 @@ int busybox_main(int argc, char **argv)
output_width -= 20;
#endif
fprintf(stderr, "%s\n\n"
"Usage: busybox [function] [arguments]...\n"
" or: [function] [arguments]...\n\n"
"\tBusyBox is a multi-call binary that combines many common Unix\n"
"\tutilities into a single executable. Most people will create a\n"
"\tlink to busybox for each function they wish to use, and BusyBox\n"
"\twill act like whatever it was invoked as.\n"
"\nCurrently defined functions:\n", bb_msg_full_version);
printf("%s\n\n"
"Usage: busybox [function] [arguments]...\n"
" or: [function] [arguments]...\n\n"
"\tBusyBox is a multi-call binary that combines many common Unix\n"
"\tutilities into a single executable. Most people will create a\n"
"\tlink to busybox for each function they wish to use and BusyBox\n"
"\twill act like whatever it was invoked as!\n"
"\nCurrently defined functions:\n", bb_msg_full_version);
while (a->name != 0) {
col +=
fprintf(stderr, "%s%s", ((col == 0) ? "\t" : ", "),
(a++)->name);
printf("%s%s", ((col == 0) ? "\t" : ", "),
(a++)->name);
if (col > output_width && a->name != 0) {
fprintf(stderr, ",\n");
printf(",\n");
col = 0;
}
}
fprintf(stderr, "\n\n");
printf("\n\n");
exit(0);
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -41,7 +41,7 @@ ARCHIVAL-$(CONFIG_UNZIP) += unzip.o
libraries-y+=$(ARCHIVAL_DIR)$(ARCHIVAL_AR)
$(ARCHIVAL_DIR)$(ARCHIVAL_AR): $(patsubst %,$(ARCHIVAL_DIR)%, $(ARCHIVAL-y))
$(AR) -ro $@ $(patsubst %,$(ARCHIVAL_DIR)%, $(ARCHIVAL-y))
$(AR) $(ARFLAGS) $@ $(patsubst %,$(ARCHIVAL_DIR)%, $(ARCHIVAL-y))
$(ARCHIVAL_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
+8 -3
View File
@@ -56,19 +56,21 @@ static void header_verbose_list_ar(const file_header_t *file_header)
#define AR_OPT_PRESERVE_DATE 0x08
#define AR_OPT_VERBOSE 0x10
#define AR_OPT_CREATE 0x20
#define AR_OPT_INSERT 0x40
extern int ar_main(int argc, char **argv)
{
archive_handle_t *archive_handle;
unsigned long opt;
char *msg_unsupported_err = "Archive %s not supported. Install binutils 'ar'.";
char magic[8];
archive_handle = init_handle();
bb_opt_complementaly = "p~tx:t~px:x~pt";
opt = bb_getopt_ulflags(argc, argv, "ptxovc");
opt = bb_getopt_ulflags(argc, argv, "ptxovcr");
if ((opt & 0x80000000UL) || (optind == argc)) {
if ((opt & BB_GETOPT_ERROR) || (opt == 0) || (optind == argc)) {
bb_show_usage();
}
@@ -88,7 +90,10 @@ extern int ar_main(int argc, char **argv)
archive_handle->action_header = header_verbose_list_ar;
}
if (opt & AR_OPT_CREATE) {
bb_error_msg_and_die("Archive creation not supported. Install binutils 'ar'.");
bb_error_msg_and_die(msg_unsupported_err, "creation");
}
if (opt & AR_OPT_INSERT) {
bb_error_msg_and_die(msg_unsupported_err, "insertion");
}
archive_handle->src_fd = bb_xopen(argv[optind++], O_RDONLY);
File renamed without changes.
File renamed without changes.
+3 -1
View File
@@ -1327,7 +1327,7 @@ void free_array(char **array)
* the status_hashtable to retrieve the info. This results in smaller code than
* scanning the status file. The resulting list, however, is unsorted.
*/
void list_packages(void)
static void list_packages(void)
{
int i;
@@ -1520,6 +1520,7 @@ static char *deb_extract_control_file_to_buffer(archive_handle_t *ar_handle, lli
{
ar_handle->sub_archive->action_data = data_extract_to_buffer;
ar_handle->sub_archive->accept = myaccept;
ar_handle->sub_archive->filter = filter_accept_list;
unpack_ar_archive(ar_handle);
close(ar_handle->src_fd);
@@ -1714,6 +1715,7 @@ int dpkg_main(int argc, char **argv)
if (package_num == -1) {
bb_error_msg("Invalid control file in %s", argv[optind]);
optind++;
continue;
}
deb_file[deb_count]->package = (unsigned int) package_num;
@@ -88,7 +88,7 @@ extern int dpkg_deb_main(int argc, char **argv)
argcount = 2;
}
if ((optind + argcount != argc) || (opt & 0x80000000UL)) {
if ((optind + argcount != argc) || (opt & BB_GETOPT_ERROR)) {
bb_show_usage();
}
File renamed without changes.
+14 -33
View File
@@ -51,12 +51,6 @@
#include <time.h>
#include "busybox.h"
#define memzero(s, n) memset ((void *)(s), 0, (n))
#ifndef RETSIGTYPE
# define RETSIGTYPE void
#endif
typedef unsigned char uch;
typedef unsigned short ush;
typedef unsigned long ulg;
@@ -214,9 +208,6 @@ typedef int file_t; /* Do not use stdio */
static int zip(int in, int out);
static int file_read(char *buf, unsigned size);
/* from gzip.c */
static RETSIGTYPE abort_gzip(void);
/* from deflate.c */
static void lm_init(ush * flags);
static ulg deflate(void);
@@ -335,7 +326,7 @@ static void put_short(ush w)
/* ========================================================================
* Signal and error handler.
*/
static void abort_gzip()
static void abort_gzip(int ignored)
{
exit(ERROR);
}
@@ -350,13 +341,6 @@ static void clear_bufs(void)
bytes_in = 0L;
}
static void write_bb_error_msg(void)
{
fputc('\n', stderr);
bb_perror_nomsg();
abort_gzip();
}
/* ===========================================================================
* Does the same as write(), but also handles partial pipe writes and checks
* for error return.
@@ -366,9 +350,7 @@ static void write_buf(int fd, void *buf, unsigned cnt)
unsigned n;
while ((n = write(fd, buf, cnt)) != cnt) {
if (n == (unsigned) (-1)) {
write_bb_error_msg();
}
if (n == (unsigned) (-1)) bb_error_msg_and_die("can't write");
cnt -= n;
buf = (void *) ((char *) buf + n);
}
@@ -559,7 +541,7 @@ static unsigned bi_reverse(unsigned code, int len)
/* ===========================================================================
* Write out any remaining bits in an incomplete byte.
*/
static void bi_windup()
static void bi_windup(void)
{
if (bi_valid > 8) {
put_short(bi_buf);
@@ -846,7 +828,7 @@ static void lm_init(ush * flags)
register unsigned j;
/* Initialize the hash table. */
memzero((char *) head, HASH_SIZE * sizeof(*head));
memset(head, 0, HASH_SIZE * sizeof(*head));
/* prev will be initialized on the fly */
*flags |= SLOW;
@@ -996,7 +978,7 @@ static void check_match(IPos start, IPos match, int length)
* file reads are performed for at least two bytes (required for the
* translate_eol option).
*/
static void fill_window()
static void fill_window(void)
{
register unsigned n, m;
unsigned more =
@@ -1060,7 +1042,7 @@ static void fill_window()
* evaluation for matches: a match is finally adopted only if there is
* no better match at the next window position.
*/
static ulg deflate()
static ulg deflate(void)
{
IPos hash_head; /* head of hash chain */
IPos prev_match; /* previous match */
@@ -1188,8 +1170,6 @@ static ulg deflate()
typedef struct dirent dir_type;
typedef RETSIGTYPE(*sig_type) (int);
/* ======================================================================== */
int gzip_main(int argc, char **argv)
{
@@ -1235,16 +1215,16 @@ int gzip_main(int argc, char **argv)
foreground = signal(SIGINT, SIG_IGN) != SIG_IGN;
if (foreground) {
(void) signal(SIGINT, (sig_type) abort_gzip);
(void) signal(SIGINT, abort_gzip);
}
#ifdef SIGTERM
if (signal(SIGTERM, SIG_IGN) != SIG_IGN) {
(void) signal(SIGTERM, (sig_type) abort_gzip);
(void) signal(SIGTERM, abort_gzip);
}
#endif
#ifdef SIGHUP
if (signal(SIGHUP, SIG_IGN) != SIG_IGN) {
(void) signal(SIGHUP, (sig_type) abort_gzip);
(void) signal(SIGHUP, abort_gzip);
}
#endif
@@ -1271,6 +1251,7 @@ int gzip_main(int argc, char **argv)
for (i = optind; i < argc; i++) {
char *path = NULL;
clear_bufs();
if (strcmp(argv[i], "-") == 0) {
time_stamp = 0;
ifile_size = -1L;
@@ -1749,7 +1730,7 @@ static void ct_init(ush * attr, int *methodp)
/* ===========================================================================
* Initialize a new block.
*/
static void init_block()
static void init_block(void)
{
int n; /* iterates over tree elements */
@@ -2162,7 +2143,7 @@ static void send_tree(ct_data * tree, int max_code)
* Construct the Huffman tree for the bit lengths and return the index in
* bl_order of the last bit length code to send.
*/
static const int build_bl_tree()
static int build_bl_tree(void)
{
int max_blindex; /* index of last bit length code of non zero freq */
@@ -2425,7 +2406,7 @@ static void compress_block(ct_data * ltree, ct_data * dtree)
* IN assertion: the fields freq of dyn_ltree are set and the total of all
* frequencies does not exceed 64K (to fit in an int on 16 bit machines).
*/
static void set_file_type()
static void set_file_type(void)
{
int n = 0;
unsigned ascii_freq = 0;
@@ -2538,7 +2519,7 @@ static int file_read(char *buf, unsigned size)
* Write the output buffer outbuf[0..outcnt-1] and update bytes_out.
* (used for the compressed data only)
*/
static void flush_outbuf()
static void flush_outbuf(void)
{
if (outcnt == 0)
return;
File renamed without changes.
@@ -77,7 +77,7 @@ LIBUNARCHIVE-$(CONFIG_UNZIP) += $(GUNZIP_FILES)
libraries-y+=$(LIBUNARCHIVE_DIR)$(LIBUNARCHIVE_AR)
$(LIBUNARCHIVE_DIR)$(LIBUNARCHIVE_AR): $(patsubst %,$(LIBUNARCHIVE_DIR)%, $(LIBUNARCHIVE-y))
$(AR) -ro $@ $(patsubst %,$(LIBUNARCHIVE_DIR)%, $(LIBUNARCHIVE-y))
$(AR) $(ARFLAGS) $@ $(patsubst %,$(LIBUNARCHIVE_DIR)%, $(LIBUNARCHIVE-y))
$(LIBUNARCHIVA_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
@@ -26,7 +26,7 @@ extern ssize_t archive_xread_all_eof(archive_handle_t *archive_handle, unsigned
size = bb_full_read(archive_handle->src_fd, buf, count);
if ((size != 0) && (size != count)) {
bb_perror_msg_and_die("Short read, read %d of %d", size, count);
bb_perror_msg_and_die("Short read, read %ld of %ld", (long)size, (long)count);
}
return(size);
}
File renamed without changes.
@@ -134,8 +134,6 @@ static unsigned int get_bits(bunzip_data *bd, char bits_wanted)
static int get_next_block(bunzip_data *bd)
{
/* Note: Ignore the warning about hufGroup, base and limit being used uninitialized.
* They will be initialized on the fist pass of the loop. */
struct group_data *hufGroup;
int dbufCount,nextSym,dbufSize,groupCount,*base,*limit,selector,
i,j,k,t,runPos,symCount,symTotal,nSelectors,byteCount[256];
@@ -286,16 +284,15 @@ static int get_next_block(bunzip_data *bd)
mtfSymbol[i]=(unsigned char)i;
}
/* Loop through compressed symbols. */
runPos=dbufCount=symCount=selector=0;
runPos=dbufCount=selector=0;
for(;;) {
/* Determine which Huffman coding group to use. */
if(!(symCount--)) {
symCount=GROUP_SIZE-1;
if(selector>=nSelectors) return RETVAL_DATA_ERROR;
hufGroup=bd->groups+selectors[selector++];
base=hufGroup->base-1;
limit=hufGroup->limit-1;
}
/* fetch next Huffman coding group from list. */
symCount=GROUP_SIZE-1;
if(selector>=nSelectors) return RETVAL_DATA_ERROR;
hufGroup=bd->groups+selectors[selector++];
base=hufGroup->base-1;
limit=hufGroup->limit-1;
continue_this_group:
/* Read next Huffman-coded symbol. */
/* Note: It is far cheaper to read maxLen bits and back up than it is
to read minLen bits and then an additional bit at a time, testing
@@ -346,7 +343,7 @@ got_huff_bits:
context). Thus space is saved. */
t += (runPos << nextSym); /* +runPos if RUNA; +2*runPos if RUNB */
runPos <<= 1;
continue;
goto end_of_huffman_loop;
}
/* When we hit the first non-run symbol after a run, we now know
how many times to repeat the last literal, so append that many
@@ -384,6 +381,10 @@ got_huff_bits:
/* We have our literal byte. Save it into dbuf. */
byteCount[uc]++;
dbuf[dbufCount++] = (unsigned int)uc;
/* Skip group initialization if we're not done with this group. Done this
* way to avoid compiler warning. */
end_of_huffman_loop:
if(symCount--) goto continue_this_group;
}
/* At this point, we've read all the Huffman-coded symbols (and repeated
runs) for this block from the input stream, and decoded them into the
@@ -151,7 +151,10 @@ static unsigned int fill_bitbuffer(unsigned int bitbuffer, unsigned int *current
/* Leave the first 4 bytes empty so we can always unwind the bitbuffer
* to the front of the bytebuffer, leave 4 bytes free at end of tail
* so we can easily top up buffer in check_trailer_gzip() */
bytebuffer_size = 4 + bb_xread(gunzip_src_fd, &bytebuffer[4], bytebuffer_max - 8);
if (!(bytebuffer_size = bb_xread(gunzip_src_fd, &bytebuffer[4], bytebuffer_max - 8))) {
bb_error_msg_and_die("unexpected end of file");
}
bytebuffer_size += 4;
bytebuffer_offset = 4;
}
bitbuffer |= ((unsigned int) bytebuffer[bytebuffer_offset]) << *current;
@@ -62,6 +62,7 @@ extern char get_header_tar(archive_handle_t *archive_handle)
} tar;
long sum = 0;
long i;
static int end = 0;
/* Align header */
data_align(archive_handle, 512);
@@ -74,8 +75,17 @@ extern char get_header_tar(archive_handle_t *archive_handle)
/* If there is no filename its an empty header */
if (tar.formated.name[0] == 0) {
if (end) {
/* This is the second consecutive empty header! End of archive!
* Read until the end to empty the pipe from gz or bz2
*/
while (bb_full_read(archive_handle->src_fd, tar.raw, 512) == 512);
return(EXIT_FAILURE);
}
end = 1;
return(EXIT_SUCCESS);
}
end = 0;
/* Check header has valid magic, "ustar" is for the proper tar
* 0's are for the old tar format
File renamed without changes.
File renamed without changes.
+1 -1
View File
@@ -724,7 +724,7 @@ int tar_main(int argc, char **argv)
);
/* Check one and only one context option was given */
if(opt & 0x80000000UL) {
if(opt & BB_GETOPT_ERROR) {
bb_show_usage();
}
#ifdef CONFIG_FEATURE_TAR_CREATE
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -37,7 +37,7 @@ CONSOLETOOLS_DIR-$(CONFIG_SETKEYCODES) += setkeycodes.o
libraries-y+=$(CONSOLETOOLS_DIR)$(CONSOLETOOLS_AR)
$(CONSOLETOOLS_DIR)$(CONSOLETOOLS_AR): $(patsubst %,$(CONSOLETOOLS_DIR)%, $(CONSOLETOOLS_DIR-y))
$(AR) -ro $@ $(patsubst %,$(CONSOLETOOLS_DIR)%, $(CONSOLETOOLS_DIR-y))
$(AR) $(ARFLAGS) $@ $(patsubst %,$(CONSOLETOOLS_DIR)%, $(CONSOLETOOLS_DIR-y))
$(CONSOLETOOLS_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -35,11 +35,11 @@ struct kbentry {
unsigned char kb_index;
unsigned short kb_value;
};
static const int KDGKBENT = 0x4B46; /* gets one entry in translation table */
#define KDGKBENT 0x4B46 /* gets one entry in translation table */
/* From <linux/keyboard.h> */
static const int NR_KEYS = 128;
static const int MAX_NR_KEYMAPS = 256;
#define NR_KEYS 128
#define MAX_NR_KEYMAPS 256
int dumpkmap_main(int argc, char **argv)
{
@@ -47,28 +47,21 @@ int dumpkmap_main(int argc, char **argv)
int i, j, fd;
char flags[MAX_NR_KEYMAPS], magic[] = "bkeymap";
if (argc>=2 && *argv[1]=='-') {
if (argc >= 2 && *argv[1] == '-')
bb_show_usage();
}
fd=bb_xopen(CURRENT_VC, O_RDWR);
fd = bb_xopen(CURRENT_VC, O_RDWR);
write(1, magic, 7);
for (i=0; i < MAX_NR_KEYMAPS; i++) flags[i]=0;
flags[0]=1;
flags[1]=1;
flags[2]=1;
flags[4]=1;
flags[5]=1;
flags[6]=1;
flags[8]=1;
flags[9]=1;
flags[10]=1;
flags[12]=1;
/* Here we want to set everything to 0 except for indexes:
* [0-2] [4-6] [8-10] [12] */
memset(flags, 0x00, MAX_NR_KEYMAPS);
memset(flags, 0x01, 13);
flags[3] = flags[7] = flags[11] = 0;
/* dump flags */
for (i=0; i < MAX_NR_KEYMAPS; i++) write(1,&flags[i],1);
write(1, flags, MAX_NR_KEYMAPS);
for (i = 0; i < MAX_NR_KEYMAPS; i++) {
if (flags[i] == 1) {
@@ -76,13 +69,13 @@ int dumpkmap_main(int argc, char **argv)
ke.kb_index = j;
ke.kb_table = i;
if (ioctl(fd, KDGKBENT, &ke) < 0) {
bb_error_msg("ioctl returned: %m, %s, %s, %xqq", (char *)&ke.kb_index,(char *)&ke.kb_table,(int)&ke.kb_value);
}
else {
write(1,(void*)&ke.kb_value,2);
}
bb_perror_msg("ioctl failed with %s, %s, %p",
(char *)&ke.kb_index,
(char *)&ke.kb_table,
&ke.kb_value);
} else {
write(1, (void*)&ke.kb_value, 2);
}
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -545,7 +545,7 @@ config CONFIG_WC
config CONFIG_WHO
bool "who"
default n
select CONFIG_FEATURE_U_W_TMP
select CONFIG_FEATURE_UTMP
help
who is used to show who is logged on.
File renamed without changes.
@@ -91,7 +91,7 @@ COREUTILS-$(CONFIG_YES) += yes.o
libraries-y+=$(COREUTILS_DIR)$(COREUTILS_AR)
$(COREUTILS_DIR)$(COREUTILS_AR): $(patsubst %,$(COREUTILS_DIR)%, $(COREUTILS-y))
$(AR) -ro $@ $(patsubst %,$(COREUTILS_DIR)%, $(COREUTILS-y))
$(AR) $(ARFLAGS) $@ $(patsubst %,$(COREUTILS_DIR)%, $(COREUTILS-y))
$(COREUTILS_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+7 -1
View File
@@ -42,7 +42,7 @@
#include "libcoreutils/coreutils.h"
/* WARNING!! ORDER IS IMPORTANT!! */
static const char cp_opts[] = "pdRfiar";
static const char cp_opts[] = "pdRfiarP";
extern int cp_main(int argc, char **argv)
{
@@ -73,6 +73,12 @@ extern int cp_main(int argc, char **argv)
*/
flags |= FILEUTILS_RECUR;
}
if (flags & 128) {
/* Make -P a synonym for -d,
* -d is the GNU option while -P is the POSIX 2003 option
*/
flags |= FILEUTILS_DEREFERENCE;
}
flags ^= FILEUTILS_DEREFERENCE; /* The sense of this flag was reversed. */
+1 -1
View File
@@ -300,7 +300,7 @@ extern int cut_main(int argc, char **argv)
part = opt & (OPT_BYTE_FLGS|OPT_CHAR_FLGS|OPT_FIELDS_FLGS);
if(part == 0)
bb_error_msg_and_die("you must specify a list of bytes, characters, or fields");
if(opt & 0x80000000UL)
if(opt & BB_GETOPT_ERROR)
bb_error_msg_and_die("only one type of list may be specified");
parse_lists(sopt);
if((opt & (OPT_DELIM_FLGS))) {
@@ -136,7 +136,6 @@ int date_main(int argc, char **argv)
{
char *date_str = NULL;
char *date_fmt = NULL;
char *t_buff;
int set_time;
int utc;
int use_arg = 0;
@@ -166,7 +165,7 @@ int date_main(int argc, char **argv)
bb_error_msg_and_die(bb_msg_memory_exhausted);
}
use_arg = opt & DATE_OPT_DATE;
if(opt & 0x80000000UL)
if(opt & BB_GETOPT_ERROR)
bb_show_usage();
#ifdef CONFIG_FEATURE_DATE_ISOFMT
if(opt & DATE_OPT_TIMESPEC) {
@@ -283,10 +282,13 @@ int date_main(int argc, char **argv)
date_fmt = "%Y.%m.%d-%H:%M:%S";
}
/* Print OUTPUT (after ALL that!) */
t_buff = xmalloc(201);
strftime(t_buff, 200, date_fmt, &tm_time);
puts(t_buff);
{
/* Print OUTPUT (after ALL that!) */
RESERVE_CONFIG_BUFFER(t_buff, 201);
strftime(t_buff, 200, date_fmt, &tm_time);
puts(t_buff);
RELEASE_CONFIG_BUFFER(t_buff);
}
return EXIT_SUCCESS;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+14 -21
View File
@@ -245,10 +245,9 @@ static int arithmetic_common (VALUE *l, VALUE *r, int op)
static VALUE *docolon (VALUE *sv, VALUE *pv)
{
VALUE *v;
const char *errmsg;
struct re_pattern_buffer re_buffer;
struct re_registers re_regs;
int len;
regex_t re_buffer;
const int NMATCH = 2;
regmatch_t re_regs[NMATCH];
tostring (sv);
tostring (pv);
@@ -260,27 +259,22 @@ of a basic regular expression is not portable; it is being ignored",
pv->u.s);
}
len = strlen (pv->u.s);
memset (&re_buffer, 0, sizeof (re_buffer));
memset (&re_regs, 0, sizeof (re_regs));
re_buffer.allocated = 2 * len;
re_buffer.buffer = (unsigned char *) xmalloc (re_buffer.allocated);
re_buffer.translate = 0;
re_syntax_options = RE_SYNTAX_POSIX_BASIC;
errmsg = re_compile_pattern (pv->u.s, len, &re_buffer);
if (errmsg) {
bb_error_msg_and_die("%s", errmsg);
}
memset (re_regs, 0, sizeof (*re_regs));
if( regcomp (&re_buffer, pv->u.s, 0) != 0 )
bb_error_msg_and_die("Invalid regular expression");
len = re_match (&re_buffer, sv->u.s, strlen (sv->u.s), 0, &re_regs);
if (len >= 0) {
/* expr uses an anchored pattern match, so check that there was a
* match and that the match starts at offset 0. */
if (regexec (&re_buffer, sv->u.s, NMATCH, re_regs, 0) != REG_NOMATCH &&
re_regs[0].rm_so == 0) {
/* Were \(...\) used? */
if (re_buffer.re_nsub > 0) { /* was (re_regs.start[1] >= 0) */
sv->u.s[re_regs.end[1]] = '\0';
v = str_value (sv->u.s + re_regs.start[1]);
if (re_buffer.re_nsub > 0) {
sv->u.s[re_regs[1].rm_eo] = '\0';
v = str_value (sv->u.s + re_regs[1].rm_so);
}
else
v = int_value (len);
v = int_value (re_regs[0].rm_eo);
}
else {
/* Match failed -- return the right kind of null. */
@@ -289,7 +283,6 @@ of a basic regular expression is not portable; it is being ignored",
else
v = int_value (0);
}
free (re_buffer.buffer);
return v;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 789 files, more files were not shown because too many files have changed in this diff. Show more