[-]
[+]
|
Changed |
busybox.changes
|
|
[-]
[+]
|
Changed |
busybox.spec
^
|
|
[-]
[+]
|
Deleted |
busybox-1.19.0-cttyhack.patch
^
|
@@ -1,18 +0,0 @@
---- busybox-1.19.0/shell/cttyhack.c
-+++ busybox-1.19.0-cttyhack/shell/cttyhack.c
-@@ -122,10 +122,12 @@ int cttyhack_main(int argc UNUSED_PARAM,
- do {
- #ifdef __linux__
- int s = open_read_close("/sys/class/tty/console/active",
-- console + 5, sizeof(console) - 5 - 1);
-+ console + 5, sizeof(console) - 5);
- if (s > 0) {
-- /* found active console via sysfs (Linux 2.6.38+) */
-- console[5 + s] = '\0';
-+ /* found active console via sysfs (Linux 2.6.38+)
-+ * sysfs string looks like "ttyS0\n" so zap the newline:
-+ */
-+ console[4 + s] = '\0';
- break;
- }
-
|
[-]
[+]
|
Deleted |
busybox-1.19.0-install.patch
^
|
@@ -1,11 +0,0 @@
---- busybox-1.19.0/applets/install.sh.orig 2011-08-11 02:23:58.000000000 +0200
-+++ busybox-1.19.0/applets/install.sh 2011-08-19 22:29:20.824991244 +0200
-@@ -9,7 +9,7 @@
- exit 1
- fi
-
--h=`sort busybox.links | uniq`
-+h=`sort /usr/share/busybox/busybox.links | uniq`
-
- linkopts=""
- scriptwrapper="n"
|
[-]
[+]
|
Deleted |
busybox-1.19.0-less.patch
^
|
@@ -1,12 +0,0 @@
---- busybox-1.19.0/miscutils/less.c
-+++ busybox-1.19.0-less/miscutils/less.c
-@@ -990,7 +990,8 @@ static int64_t less_getch(int pos)
- */
- if (key >= 0 && key < ' ' && key != 0x0d && key != 8)
- goto again;
-- return key;
-+
-+ return key64;
- }
-
- static char* less_gets(int sz)
|
[-]
[+]
|
Deleted |
busybox-1.19.0-sed.patch
^
|
@@ -1,237 +0,0 @@
---- busybox-1.19.0/editors/sed.c
-+++ busybox-1.19.0-sed/editors/sed.c
-@@ -75,6 +75,13 @@
- #include "libbb.h"
- #include "xregex.h"
-
-+#if 0
-+# define dbg(...) bb_error_msg(__VA_ARGS__)
-+#else
-+# define dbg(...) ((void)0)
-+#endif
-+
-+
- enum {
- OPT_in_place = 1 << 0,
- };
-@@ -89,6 +96,7 @@ typedef struct sed_cmd_s {
- regex_t *end_match; /* sed -e '/match/,/end_match/cmd' */
- regex_t *sub_match; /* For 's/sub_match/string/' */
- int beg_line; /* 'sed 1p' 0 == apply commands to all lines */
-+ int beg_line_orig; /* copy of the above, needed for -i */
- int end_line; /* 'sed 1,3p' 0 == one line only. -1 = last line ($) */
-
- FILE *sw_file; /* File (sw) command writes to, -1 for none. */
-@@ -123,7 +131,7 @@ struct globals {
- regex_t *previous_regex_ptr;
-
- /* linked list of sed commands */
-- sed_cmd_t sed_cmd_head, *sed_cmd_tail;
-+ sed_cmd_t *sed_cmd_head, **sed_cmd_tail;
-
- /* Linked list of append lines */
- llist_t *append_head;
-@@ -148,7 +156,7 @@ struct BUG_G_too_big {
- #if ENABLE_FEATURE_CLEAN_UP
- static void sed_free_and_close_stuff(void)
- {
-- sed_cmd_t *sed_cmd = G.sed_cmd_head.next;
-+ sed_cmd_t *sed_cmd = G.sed_cmd_head;
-
- llist_free(G.append_head, free);
-
-@@ -599,6 +607,7 @@ static void add_cmd(const char *cmdstr)
-
- /* first part (if present) is an address: either a '$', a number or a /regex/ */
- cmdstr += get_address(cmdstr, &sed_cmd->beg_line, &sed_cmd->beg_match);
-+ sed_cmd->beg_line_orig = sed_cmd->beg_line;
-
- /* second part (if present) will begin with a comma */
- if (*cmdstr == ',') {
-@@ -630,8 +639,8 @@ static void add_cmd(const char *cmdstr)
- cmdstr = parse_cmd_args(sed_cmd, cmdstr);
-
- /* Add the command to the command array */
-- G.sed_cmd_tail->next = sed_cmd;
-- G.sed_cmd_tail = G.sed_cmd_tail->next;
-+ *G.sed_cmd_tail = sed_cmd;
-+ G.sed_cmd_tail = &sed_cmd->next;
- }
-
- /* If we glued multiple lines together, free the memory. */
-@@ -777,7 +786,7 @@ static sed_cmd_t *branch_to(char *label)
- {
- sed_cmd_t *sed_cmd;
-
-- for (sed_cmd = G.sed_cmd_head.next; sed_cmd; sed_cmd = sed_cmd->next) {
-+ for (sed_cmd = G.sed_cmd_head; sed_cmd; sed_cmd = sed_cmd->next) {
- if (sed_cmd->cmd == ':' && sed_cmd->string && !strcmp(sed_cmd->string, label)) {
- return sed_cmd;
- }
-@@ -953,24 +962,24 @@ static void process_files(void)
-
- /* For every line, go through all the commands */
- restart:
-- for (sed_cmd = G.sed_cmd_head.next; sed_cmd; sed_cmd = sed_cmd->next) {
-+ for (sed_cmd = G.sed_cmd_head; sed_cmd; sed_cmd = sed_cmd->next) {
- int old_matched, matched;
-
- old_matched = sed_cmd->in_match;
-
- /* Determine if this command matches this line: */
-
-- //bb_error_msg("match1:%d", sed_cmd->in_match);
-- //bb_error_msg("match2:%d", (!sed_cmd->beg_line && !sed_cmd->end_line
-- // && !sed_cmd->beg_match && !sed_cmd->end_match));
-- //bb_error_msg("match3:%d", (sed_cmd->beg_line > 0
-- // && (sed_cmd->end_line || sed_cmd->end_match
-- // ? (sed_cmd->beg_line <= linenum)
-- // : (sed_cmd->beg_line == linenum)
-- // )
-- // )
-- //bb_error_msg("match4:%d", (beg_match(sed_cmd, pattern_space)));
-- //bb_error_msg("match5:%d", (sed_cmd->beg_line == -1 && next_line == NULL));
-+ dbg("match1:%d", sed_cmd->in_match);
-+ dbg("match2:%d", (!sed_cmd->beg_line && !sed_cmd->end_line
-+ && !sed_cmd->beg_match && !sed_cmd->end_match));
-+ dbg("match3:%d", (sed_cmd->beg_line > 0
-+ && (sed_cmd->end_line || sed_cmd->end_match
-+ ? (sed_cmd->beg_line <= linenum)
-+ : (sed_cmd->beg_line == linenum)
-+ )
-+ ));
-+ dbg("match4:%d", (beg_match(sed_cmd, pattern_space)));
-+ dbg("match5:%d", (sed_cmd->beg_line == -1 && next_line == NULL));
-
- /* Are we continuing a previous multi-line match? */
- sed_cmd->in_match = sed_cmd->in_match
-@@ -981,7 +990,14 @@ static void process_files(void)
- || (sed_cmd->beg_line > 0
- && (sed_cmd->end_line || sed_cmd->end_match
- /* note: even if end is numeric and is < linenum too,
-- * GNU sed matches! We match too */
-+ * GNU sed matches! We match too, therefore we don't
-+ * check here that linenum <= end.
-+ * Example:
-+ * printf '1\n2\n3\n4\n' | sed -n '1{N;N;d};1p;2,3p;3p;4p'
-+ * first three input lines are deleted;
-+ * 4th line is matched and printed
-+ * by "2,3" (!) and by "4" ranges
-+ */
- ? (sed_cmd->beg_line <= linenum) /* N,end */
- : (sed_cmd->beg_line == linenum) /* N */
- )
-@@ -994,16 +1010,14 @@ static void process_files(void)
- /* Snapshot the value */
- matched = sed_cmd->in_match;
-
-- //bb_error_msg("cmd:'%c' matched:%d beg_line:%d end_line:%d linenum:%d",
-- //sed_cmd->cmd, matched, sed_cmd->beg_line, sed_cmd->end_line, linenum);
-+ dbg("cmd:'%c' matched:%d beg_line:%d end_line:%d linenum:%d",
-+ sed_cmd->cmd, matched, sed_cmd->beg_line, sed_cmd->end_line, linenum);
-
- /* Is this line the end of the current match? */
-
- if (matched) {
- /* once matched, "n,xxx" range is dead, disabling it */
-- if (sed_cmd->beg_line > 0
-- && !(option_mask32 & OPT_in_place) /* but not for -i */
-- ) {
-+ if (sed_cmd->beg_line > 0) {
- sed_cmd->beg_line = -2;
- }
- sed_cmd->in_match = !(
-@@ -1017,7 +1031,8 @@ static void process_files(void)
- /* or does this line matches our last address regex */
- || (sed_cmd->end_match && old_matched
- && (regexec(sed_cmd->end_match,
-- pattern_space, 0, NULL, 0) == 0))
-+ pattern_space, 0, NULL, 0) == 0)
-+ )
- );
- }
-
-@@ -1407,11 +1422,12 @@ int sed_main(int argc UNUSED_PARAM, char
- add_input_file(stdin);
- } else {
- int i;
-- FILE *file;
-
- for (i = 0; argv[i]; i++) {
- struct stat statbuf;
- int nonstdoutfd;
-+ FILE *file;
-+ sed_cmd_t *sed_cmd;
-
- if (LONE_DASH(argv[i]) && !(opt & OPT_in_place)) {
- add_input_file(stdin);
-@@ -1423,11 +1439,13 @@ int sed_main(int argc UNUSED_PARAM, char
- status = EXIT_FAILURE;
- continue;
- }
-+ add_input_file(file);
- if (!(opt & OPT_in_place)) {
-- add_input_file(file);
- continue;
- }
-
-+ /* -i: process each FILE separately: */
-+
- G.outname = xasprintf("%sXXXXXX", argv[i]);
- nonstdoutfd = xmkstemp(G.outname);
- G.nonstdout = xfdopen_for_write(nonstdoutfd);
-@@ -1438,15 +1456,20 @@ int sed_main(int argc UNUSED_PARAM, char
- * but GNU sed 4.2.1 does not preserve them either */
- fchmod(nonstdoutfd, statbuf.st_mode);
- fchown(nonstdoutfd, statbuf.st_uid, statbuf.st_gid);
-- add_input_file(file);
-+
- process_files();
- fclose(G.nonstdout);
--
- G.nonstdout = stdout;
-+
- /* unlink(argv[i]); */
- xrename(G.outname, argv[i]);
- free(G.outname);
- G.outname = NULL;
-+
-+ /* Re-enable disabled range matches */
|
[-]
[+]
|
Deleted |
busybox-1.19.0-swap.patch
^
|
@@ -1,12 +0,0 @@
---- busybox-1.19.0/util-linux/swaponoff.c
-+++ busybox-1.19.0-swap/util-linux/swaponoff.c
-@@ -114,7 +114,8 @@ int swap_on_off_main(int argc UNUSED_PAR
- #if !ENABLE_FEATURE_SWAPON_PRI
- ret = getopt32(argv, "a");
- #else
-- opt_complementary = "p+";
-+ if (applet_name[5] == 'n')
-+ opt_complementary = "p+";
- ret = getopt32(argv, (applet_name[5] == 'n') ? "ap:" : "a", &g_flags);
-
- if (ret & 2) { // -p
|
[-]
[+]
|
Deleted |
busybox-1.19.0-udhcp-services.patch
^
|
@@ -1,24 +0,0 @@
---- networking/udhcp/common.c.orig 2010-08-23 02:44:35.000000000 +0200
-+++ networking/udhcp/common.c 2010-09-29 12:15:08.514367497 +0200
-@@ -49,6 +49,10 @@
- { OPTION_STRING , 0x43 }, /* DHCP_BOOT_FILE */
- //TODO: not a string, but a set of LASCII strings:
- // { OPTION_STRING , 0x4D }, /* DHCP_USER_CLASS */
-+ { OPTION_IP | OPTION_LIST , 0x45 }, /* DHCP_SMTP_SERVER */
-+ { OPTION_IP | OPTION_LIST , 0x46 }, /* DHCP_POP3_SERVER */
-+ { OPTION_IP | OPTION_LIST , 0x4a }, /* DHCP_IRC_SERVER */
-+ { OPTION_IP | OPTION_LIST , 0x48 }, /* DHCP_WWW_SERVER */
- #if ENABLE_FEATURE_UDHCP_RFC3397
- { OPTION_DNS_STRING | OPTION_LIST , 0x77 }, /* DHCP_DOMAIN_SEARCH */
- { OPTION_SIP_SERVERS , 0x78 }, /* DHCP_SIP_SERVERS */
-@@ -105,6 +109,10 @@
- "tftp" "\0" /* DHCP_TFTP_SERVER_NAME */
- "bootfile" "\0" /* DHCP_BOOT_FILE */
- // "userclass" "\0" /* DHCP_USER_CLASS */
-+ "smtpsrv" "\0" /* DHCP_SMTP_SERVER */
-+ "pop3srv" "\0" /* DHCP_POP3_SERVER */
-+ "ircsrv" "\0" /* DHCP_IRC_SERVER */
-+ "wwwsrv" "\0" /* DHCP_WWW_SERVER */
- #if ENABLE_FEATURE_UDHCP_RFC3397
- "search" "\0" /* DHCP_DOMAIN_SEARCH */
- // doesn't work in udhcpd.conf since OPTION_SIP_SERVERS
|
[-]
[+]
|
Deleted |
busybox-1.19.0-uncompress.patch
^
|
@@ -1,50 +0,0 @@
---- busybox-1.19.0/archival/libarchive/decompress_uncompress.c
-+++ busybox-1.19.0-uncompress/archival/libarchive/decompress_uncompress.c
-@@ -163,7 +163,8 @@ unpack_Z_stream(int fd_in, int fd_out)
-
- if (insize < (int) (IBUFSIZ + 64) - IBUFSIZ) {
- rsize = safe_read(fd_in, inbuf + insize, IBUFSIZ);
--//error check??
-+ if (rsize < 0)
-+ bb_error_msg(bb_msg_read_error);
- insize += rsize;
- }
-
-@@ -195,6 +196,8 @@ unpack_Z_stream(int fd_in, int fd_out)
-
-
- if (oldcode == -1) {
-+ if (code >= 256)
-+ bb_error_msg_and_die("corrupted data"); /* %ld", code); */
- oldcode = code;
- finchar = (int) oldcode;
- outbuf[outpos++] = (unsigned char) finchar;
-@@ -239,6 +242,8 @@ unpack_Z_stream(int fd_in, int fd_out)
-
- /* Generate output characters in reverse order */
- while ((long) code >= (long) 256) {
-+ if (stackp <= &htabof(0))
-+ bb_error_msg_and_die("corrupted data");
- *--stackp = tab_suffixof(code);
- code = tab_prefixof(code);
- }
-@@ -263,8 +268,7 @@ unpack_Z_stream(int fd_in, int fd_out)
- }
-
- if (outpos >= OBUFSIZ) {
-- full_write(fd_out, outbuf, outpos);
--//error check??
-+ xwrite(fd_out, outbuf, outpos);
- IF_DESKTOP(total_written += outpos;)
- outpos = 0;
- }
-@@ -292,8 +296,7 @@ unpack_Z_stream(int fd_in, int fd_out)
- } while (rsize > 0);
-
- if (outpos > 0) {
-- full_write(fd_out, outbuf, outpos);
--//error check??
-+ xwrite(fd_out, outbuf, outpos);
- IF_DESKTOP(total_written += outpos;)
- }
-
|
[-]
[+]
|
Added |
busybox-1.19.3-getty.patch
^
|
@@ -0,0 +1,12 @@
+--- busybox-1.19.3/loginutils/getty.c
++++ busybox-1.19.3-getty/loginutils/getty.c
+@@ -271,7 +271,9 @@ static void termios_init(int speed)
+ #ifdef CMSPAR
+ | CMSPAR /* mark or space parity */
+ #endif
++#ifdef CBAUD
+ | CBAUD /* (output) baud rate */
++#endif
+ #ifdef CBAUDEX
+ | CBAUDEX /* (output) baud rate */
+ #endif
|
[-]
[+]
|
Added |
busybox-1.19.3-install.patch
^
|
@@ -0,0 +1,13 @@
+--- busybox-1.19.0/applets/install.sh.orig 2011-08-11 02:23:58.000000000 +0200
++++ busybox-1.19.0/applets/install.sh 2011-08-19 22:29:20.824991244 +0200
+@@ -9,7 +9,7 @@
+ exit 1
+ fi
+
+-h=`sort busybox.links | uniq`
++h=`sort /usr/share/busybox/busybox.links | uniq`
+
+ linkopts=""
+ scriptwrapper="n"
+
+
|
[-]
[+]
|
Added |
busybox-1.19.3-modinfo.patch
^
|
@@ -0,0 +1,10 @@
+--- busybox-1.19.3/modutils/modinfo.c
++++ busybox-1.19.3-modinfo/modutils/modinfo.c
+@@ -13,6 +13,7 @@
+ //config:config MODINFO
+ //config: bool "modinfo"
+ //config: default y
++//config: select PLATFORM_LINUX
+ //config: help
+ //config: Show information about a Linux Kernel module
+
|
[-]
[+]
|
Added |
busybox-1.19.3-udhcp-services.patch
^
|
@@ -0,0 +1,24 @@
+--- networking/udhcp/common.c.orig 2010-08-23 02:44:35.000000000 +0200
++++ networking/udhcp/common.c 2010-09-29 12:15:08.514367497 +0200
+@@ -49,6 +49,10 @@
+ { OPTION_STRING , 0x43 }, /* DHCP_BOOT_FILE */
+ //TODO: not a string, but a set of LASCII strings:
+ // { OPTION_STRING , 0x4D }, /* DHCP_USER_CLASS */
++ { OPTION_IP | OPTION_LIST , 0x45 }, /* DHCP_SMTP_SERVER */
++ { OPTION_IP | OPTION_LIST , 0x46 }, /* DHCP_POP3_SERVER */
++ { OPTION_IP | OPTION_LIST , 0x4a }, /* DHCP_IRC_SERVER */
++ { OPTION_IP | OPTION_LIST , 0x48 }, /* DHCP_WWW_SERVER */
+ #if ENABLE_FEATURE_UDHCP_RFC3397
+ { OPTION_DNS_STRING | OPTION_LIST , 0x77 }, /* DHCP_DOMAIN_SEARCH */
+ { OPTION_SIP_SERVERS , 0x78 }, /* DHCP_SIP_SERVERS */
+@@ -105,6 +109,10 @@
+ "tftp" "\0" /* DHCP_TFTP_SERVER_NAME */
+ "bootfile" "\0" /* DHCP_BOOT_FILE */
+ // "userclass" "\0" /* DHCP_USER_CLASS */
++ "smtpsrv" "\0" /* DHCP_SMTP_SERVER */
++ "pop3srv" "\0" /* DHCP_POP3_SERVER */
++ "ircsrv" "\0" /* DHCP_IRC_SERVER */
++ "wwwsrv" "\0" /* DHCP_WWW_SERVER */
+ #if ENABLE_FEATURE_UDHCP_RFC3397
+ "search" "\0" /* DHCP_DOMAIN_SEARCH */
+ // doesn't work in udhcpd.conf since OPTION_SIP_SERVERS
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/Makefile
^
|
@@ -1,6 +1,6 @@
VERSION = 1
PATCHLEVEL = 19
-SUBLEVEL = 0
+SUBLEVEL = 3
EXTRAVERSION =
NAME = Unnamed
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/applets/applet_tables.c
^
|
@@ -80,8 +80,15 @@
printf("#define NUM_APPLETS %u\n", NUM_APPLETS);
if (NUM_APPLETS == 1) {
+ char *dash_to_underscore, *p;
printf("#define SINGLE_APPLET_STR \"%s\"\n", applets[0].name);
- printf("#define SINGLE_APPLET_MAIN %s_main\n", applets[0].name);
+ /* Example: "ether-wake" -> "ether_wake" */
+ p = dash_to_underscore = strdup(applets[0].name);
+ p--;
+ while (*++p)
+ if (*p == '-')
+ *p = '_';
+ printf("#define SINGLE_APPLET_MAIN %s_main\n", dash_to_underscore);
}
printf("\n");
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/archival/libarchive/decompress_uncompress.c
^
|
@@ -163,7 +163,8 @@
if (insize < (int) (IBUFSIZ + 64) - IBUFSIZ) {
rsize = safe_read(fd_in, inbuf + insize, IBUFSIZ);
-//error check??
+ if (rsize < 0)
+ bb_error_msg_and_die(bb_msg_read_error);
insize += rsize;
}
@@ -195,6 +196,8 @@
if (oldcode == -1) {
+ if (code >= 256)
+ bb_error_msg_and_die("corrupted data"); /* %ld", code); */
oldcode = code;
finchar = (int) oldcode;
outbuf[outpos++] = (unsigned char) finchar;
@@ -239,6 +242,8 @@
/* Generate output characters in reverse order */
while ((long) code >= (long) 256) {
+ if (stackp <= &htabof(0))
+ bb_error_msg_and_die("corrupted data");
*--stackp = tab_suffixof(code);
code = tab_prefixof(code);
}
@@ -263,8 +268,7 @@
}
if (outpos >= OBUFSIZ) {
- full_write(fd_out, outbuf, outpos);
-//error check??
+ xwrite(fd_out, outbuf, outpos);
IF_DESKTOP(total_written += outpos;)
outpos = 0;
}
@@ -292,8 +296,7 @@
} while (rsize > 0);
if (outpos > 0) {
- full_write(fd_out, outbuf, outpos);
-//error check??
+ xwrite(fd_out, outbuf, outpos);
IF_DESKTOP(total_written += outpos;)
}
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/coreutils/tail.c
^
|
@@ -203,7 +203,7 @@
int fd = fds[i];
if (ENABLE_FEATURE_FANCY_TAIL && fd < 0)
- continue; /* may happen with -E */
+ continue; /* may happen with -F */
if (nfiles > header_threshhold) {
tail_xprint_header(fmt, argv[i]);
@@ -252,14 +252,14 @@
* Used only by +N code ("start from Nth", 1-based): */
seen = 1;
newlines_seen = 0;
- while ((nread = tail_read(fd, buf, tailbufsize-taillen)) > 0) {
+ while ((nread = tail_read(fd, buf, tailbufsize - taillen)) > 0) {
if (G.from_top) {
int nwrite = nread;
if (seen < count) {
/* We need to skip a few more bytes/lines */
if (COUNT_BYTES) {
nwrite -= (count - seen);
- seen = count;
+ seen += nread;
} else {
char *s = buf;
do {
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/editors/patch.c
^
|
@@ -70,8 +70,7 @@
// Free all the elements of a linked list
// Call freeit() on each element before freeing it.
-static
-void dlist_free(struct double_list *list, void (*freeit)(void *data))
+static void dlist_free(struct double_list *list, void (*freeit)(void *data))
{
while (list) {
void *pop = list;
@@ -83,8 +82,7 @@
}
// Add an entry before "list" element in (circular) doubly linked list
-static
-struct double_list *dlist_add(struct double_list **list, char *data)
+static struct double_list *dlist_add(struct double_list **list, char *data)
{
struct double_list *llist;
struct double_list *line = xmalloc(sizeof(*line));
@@ -232,7 +230,7 @@
else matcheof = 0;
if (PATCH_DEBUG) fdprintf(2, "HUNK:%s\n", plist->data);
}
- matcheof = matcheof < TT.context;
+ matcheof = !matcheof || matcheof < TT.context;
if (PATCH_DEBUG) fdprintf(2,"MATCHEOF=%c\n", matcheof ? 'Y' : 'N');
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/editors/sed.c
^
|
@@ -75,6 +75,13 @@
#include "libbb.h"
#include "xregex.h"
+#if 0
+# define dbg(...) bb_error_msg(__VA_ARGS__)
+#else
+# define dbg(...) ((void)0)
+#endif
+
+
enum {
OPT_in_place = 1 << 0,
};
@@ -89,6 +96,7 @@
regex_t *end_match; /* sed -e '/match/,/end_match/cmd' */
regex_t *sub_match; /* For 's/sub_match/string/' */
int beg_line; /* 'sed 1p' 0 == apply commands to all lines */
+ int beg_line_orig; /* copy of the above, needed for -i */
int end_line; /* 'sed 1,3p' 0 == one line only. -1 = last line ($) */
FILE *sw_file; /* File (sw) command writes to, -1 for none. */
@@ -123,7 +131,7 @@
regex_t *previous_regex_ptr;
/* linked list of sed commands */
- sed_cmd_t sed_cmd_head, *sed_cmd_tail;
+ sed_cmd_t *sed_cmd_head, **sed_cmd_tail;
/* Linked list of append lines */
llist_t *append_head;
@@ -148,7 +156,7 @@
#if ENABLE_FEATURE_CLEAN_UP
static void sed_free_and_close_stuff(void)
{
- sed_cmd_t *sed_cmd = G.sed_cmd_head.next;
+ sed_cmd_t *sed_cmd = G.sed_cmd_head;
llist_free(G.append_head, free);
@@ -599,6 +607,7 @@
/* first part (if present) is an address: either a '$', a number or a /regex/ */
cmdstr += get_address(cmdstr, &sed_cmd->beg_line, &sed_cmd->beg_match);
+ sed_cmd->beg_line_orig = sed_cmd->beg_line;
/* second part (if present) will begin with a comma */
if (*cmdstr == ',') {
@@ -630,8 +639,8 @@
cmdstr = parse_cmd_args(sed_cmd, cmdstr);
/* Add the command to the command array */
- G.sed_cmd_tail->next = sed_cmd;
- G.sed_cmd_tail = G.sed_cmd_tail->next;
+ *G.sed_cmd_tail = sed_cmd;
+ G.sed_cmd_tail = &sed_cmd->next;
}
/* If we glued multiple lines together, free the memory. */
@@ -777,7 +786,7 @@
{
sed_cmd_t *sed_cmd;
- for (sed_cmd = G.sed_cmd_head.next; sed_cmd; sed_cmd = sed_cmd->next) {
+ for (sed_cmd = G.sed_cmd_head; sed_cmd; sed_cmd = sed_cmd->next) {
if (sed_cmd->cmd == ':' && sed_cmd->string && !strcmp(sed_cmd->string, label)) {
return sed_cmd;
}
@@ -953,24 +962,24 @@
/* For every line, go through all the commands */
restart:
- for (sed_cmd = G.sed_cmd_head.next; sed_cmd; sed_cmd = sed_cmd->next) {
+ for (sed_cmd = G.sed_cmd_head; sed_cmd; sed_cmd = sed_cmd->next) {
int old_matched, matched;
old_matched = sed_cmd->in_match;
/* Determine if this command matches this line: */
- //bb_error_msg("match1:%d", sed_cmd->in_match);
- //bb_error_msg("match2:%d", (!sed_cmd->beg_line && !sed_cmd->end_line
- // && !sed_cmd->beg_match && !sed_cmd->end_match));
- //bb_error_msg("match3:%d", (sed_cmd->beg_line > 0
- // && (sed_cmd->end_line || sed_cmd->end_match
- // ? (sed_cmd->beg_line <= linenum)
- // : (sed_cmd->beg_line == linenum)
- // )
- // )
- //bb_error_msg("match4:%d", (beg_match(sed_cmd, pattern_space)));
- //bb_error_msg("match5:%d", (sed_cmd->beg_line == -1 && next_line == NULL));
+ dbg("match1:%d", sed_cmd->in_match);
+ dbg("match2:%d", (!sed_cmd->beg_line && !sed_cmd->end_line
+ && !sed_cmd->beg_match && !sed_cmd->end_match));
+ dbg("match3:%d", (sed_cmd->beg_line > 0
+ && (sed_cmd->end_line || sed_cmd->end_match
+ ? (sed_cmd->beg_line <= linenum)
+ : (sed_cmd->beg_line == linenum)
+ )
+ ));
+ dbg("match4:%d", (beg_match(sed_cmd, pattern_space)));
+ dbg("match5:%d", (sed_cmd->beg_line == -1 && next_line == NULL));
/* Are we continuing a previous multi-line match? */
sed_cmd->in_match = sed_cmd->in_match
@@ -981,7 +990,14 @@
|| (sed_cmd->beg_line > 0
&& (sed_cmd->end_line || sed_cmd->end_match
/* note: even if end is numeric and is < linenum too,
- * GNU sed matches! We match too */
+ * GNU sed matches! We match too, therefore we don't
+ * check here that linenum <= end.
+ * Example:
+ * printf '1\n2\n3\n4\n' | sed -n '1{N;N;d};1p;2,3p;3p;4p'
+ * first three input lines are deleted;
+ * 4th line is matched and printed
+ * by "2,3" (!) and by "4" ranges
+ */
? (sed_cmd->beg_line <= linenum) /* N,end */
: (sed_cmd->beg_line == linenum) /* N */
)
@@ -994,16 +1010,14 @@
/* Snapshot the value */
matched = sed_cmd->in_match;
- //bb_error_msg("cmd:'%c' matched:%d beg_line:%d end_line:%d linenum:%d",
- //sed_cmd->cmd, matched, sed_cmd->beg_line, sed_cmd->end_line, linenum);
+ dbg("cmd:'%c' matched:%d beg_line:%d end_line:%d linenum:%d",
+ sed_cmd->cmd, matched, sed_cmd->beg_line, sed_cmd->end_line, linenum);
/* Is this line the end of the current match? */
if (matched) {
/* once matched, "n,xxx" range is dead, disabling it */
- if (sed_cmd->beg_line > 0
- && !(option_mask32 & OPT_in_place) /* but not for -i */
- ) {
+ if (sed_cmd->beg_line > 0) {
sed_cmd->beg_line = -2;
}
sed_cmd->in_match = !(
@@ -1017,7 +1031,8 @@
/* or does this line matches our last address regex */
|| (sed_cmd->end_match && old_matched
&& (regexec(sed_cmd->end_match,
- pattern_space, 0, NULL, 0) == 0))
+ pattern_space, 0, NULL, 0) == 0)
+ )
);
}
@@ -1407,11 +1422,12 @@
add_input_file(stdin);
} else {
int i;
- FILE *file;
for (i = 0; argv[i]; i++) {
struct stat statbuf;
int nonstdoutfd;
+ FILE *file;
+ sed_cmd_t *sed_cmd;
if (LONE_DASH(argv[i]) && !(opt & OPT_in_place)) {
add_input_file(stdin);
@@ -1423,11 +1439,13 @@
status = EXIT_FAILURE;
continue;
}
+ add_input_file(file);
if (!(opt & OPT_in_place)) {
- add_input_file(file);
continue;
}
+ /* -i: process each FILE separately: */
+
G.outname = xasprintf("%sXXXXXX", argv[i]);
nonstdoutfd = xmkstemp(G.outname);
G.nonstdout = xfdopen_for_write(nonstdoutfd);
@@ -1438,15 +1456,20 @@
* but GNU sed 4.2.1 does not preserve them either */
fchmod(nonstdoutfd, statbuf.st_mode);
fchown(nonstdoutfd, statbuf.st_uid, statbuf.st_gid);
- add_input_file(file);
+
process_files();
fclose(G.nonstdout);
-
G.nonstdout = stdout;
+
/* unlink(argv[i]); */
xrename(G.outname, argv[i]);
free(G.outname);
G.outname = NULL;
+
+ /* Re-enable disabled range matches */
+ for (sed_cmd = G.sed_cmd_head; sed_cmd; sed_cmd = sed_cmd->next) {
+ sed_cmd->beg_line = sed_cmd->beg_line_orig;
+ }
}
/* Here, to handle "sed 'cmds' nonexistent_file" case we did:
* if (G.current_input_file >= G.input_file_count)
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/findutils/find.c
^
|
@@ -932,7 +932,10 @@
* expression is reached.
*/
/* Options */
- if (0) { }
+ if (parm == OPT_FOLLOW) {
+ dbg("follow enabled: %d", __LINE__);
+ G.recurse_flags |= ACTION_FOLLOWLINKS | ACTION_DANGLING_OK;
+ }
#if ENABLE_FEATURE_FIND_XDEV
else if (parm == OPT_XDEV) {
dbg("%d", __LINE__);
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/findutils/grep.c
^
|
@@ -562,20 +562,20 @@
static void load_regexes_from_file(llist_t *fopt)
{
- char *line;
- FILE *f;
-
while (fopt) {
+ char *line;
+ FILE *fp;
llist_t *cur = fopt;
char *ffile = cur->data;
fopt = cur->link;
free(cur);
- f = xfopen_stdin(ffile);
- while ((line = xmalloc_fgetline(f)) != NULL) {
+ fp = xfopen_stdin(ffile);
+ while ((line = xmalloc_fgetline(fp)) != NULL) {
llist_add_to(&pattern_head,
new_grep_list_data(line, ALLOCATED));
}
+ fclose_if_not_stdin(fp);
}
}
@@ -659,15 +659,19 @@
#endif
invert_search = ((option_mask32 & OPT_v) != 0); /* 0 | 1 */
- if (pattern_head != NULL) {
- /* convert char **argv to grep_list_data_t */
+ { /* convert char **argv to grep_list_data_t */
llist_t *cur;
-
for (cur = pattern_head; cur; cur = cur->link)
cur->data = new_grep_list_data(cur->data, 0);
}
- if (option_mask32 & OPT_f)
+ if (option_mask32 & OPT_f) {
load_regexes_from_file(fopt);
+ if (!pattern_head) { /* -f EMPTY_FILE? */
+ /* GNU grep treats it as "nothing matches" */
+ llist_add_to(&pattern_head, new_grep_list_data((char*) "", 0));
+ invert_search ^= 1;
+ }
+ }
if (ENABLE_FEATURE_GREP_FGREP_ALIAS && applet_name[0] == 'f')
option_mask32 |= OPT_F;
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/include/platform.h
^
|
@@ -417,6 +417,8 @@
# undef HAVE_STRVERSCMP
# undef HAVE_XTABS
# undef HAVE_DPRINTF
+# undef HAVE_UNLOCKED_STDIO
+# undef HAVE_UNLOCKED_LINE_OPS
#endif
#if defined(__FreeBSD__)
@@ -431,7 +433,7 @@
# undef HAVE_STPCPY
#endif
-#if defined(ANDROID)
+#if defined(ANDROID) || defined(__ANDROID__)
# undef HAVE_DPRINTF
# undef HAVE_GETLINE
# undef HAVE_STPCPY
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/libbb/getpty.c
^
|
@@ -19,20 +19,22 @@
if (p > 0) {
grantpt(p); /* chmod+chown corresponding slave pty */
unlockpt(p); /* (what does this do?) */
-#ifndef HAVE_PTSNAME_R
- const char *name;
- name = ptsname(p); /* find out the name of slave pty */
- if (!name) {
- bb_perror_msg_and_die("ptsname error (is /dev/pts mounted?)");
+# ifndef HAVE_PTSNAME_R
+ {
+ const char *name;
+ name = ptsname(p); /* find out the name of slave pty */
+ if (!name) {
+ bb_perror_msg_and_die("ptsname error (is /dev/pts mounted?)");
+ }
+ safe_strncpy(line, name, GETPTY_BUFSIZE);
}
- safe_strncpy(line, name, GETPTY_BUFSIZE);
-#else
+# else
/* find out the name of slave pty */
if (ptsname_r(p, line, GETPTY_BUFSIZE-1) != 0) {
bb_perror_msg_and_die("ptsname error (is /dev/pts mounted?)");
}
line[GETPTY_BUFSIZE-1] = '\0';
-#endif
+# endif
return p;
}
#else
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/libbb/lineedit.c
^
|
@@ -1425,7 +1425,7 @@
/* write out temp file and replace hist_file atomically */
new_name = xasprintf("%s.%u.new", state->hist_file, (int) getpid());
- fd = open(state->hist_file, O_WRONLY | O_CREAT | O_TRUNC, 0600);
+ fd = open(new_name, O_WRONLY | O_CREAT | O_TRUNC, 0600);
if (fd >= 0) {
FILE *fp;
int i;
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/libbb/match_fstype.c
^
|
@@ -12,6 +12,8 @@
#include "libbb.h"
+#ifdef HAVE_MNTENT_H
+
int FAST_FUNC match_fstype(const struct mntent *mt, const char *t_fstype)
{
int match = 1;
@@ -40,3 +42,5 @@
return !match;
}
+
+#endif /* HAVE_MNTENT_H */
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/libbb/procps.c
^
|
@@ -284,27 +284,25 @@
void BUG_comm_size(void);
procps_status_t* FAST_FUNC procps_scan(procps_status_t* sp, int flags)
{
- struct dirent *entry;
- char buf[PROCPS_BUFSIZE];
- char filename[sizeof("/proc//cmdline") + sizeof(int)*3];
- char *filename_tail;
- long tasknice;
- unsigned pid;
- int n;
- struct stat sb;
-
if (!sp)
sp = alloc_procps_scan();
for (;;) {
+ struct dirent *entry;
+ char buf[PROCPS_BUFSIZE];
+ long tasknice;
+ unsigned pid;
+ int n;
+ char filename[sizeof("/proc/%u/task/%u/cmdline") + sizeof(int)*3 * 2];
+ char *filename_tail;
+
#if ENABLE_FEATURE_SHOW_THREADS
- if ((flags & PSSCAN_TASKS) && sp->task_dir) {
+ if (sp->task_dir) {
entry = readdir(sp->task_dir);
if (entry)
goto got_entry;
closedir(sp->task_dir);
sp->task_dir = NULL;
- sp->main_thread_pid = 0;
}
#endif
entry = readdir(sp->dir);
@@ -321,9 +319,9 @@
/* We found another /proc/PID. Do not use it,
* there will be /proc/PID/task/PID (same PID!),
* so just go ahead and dive into /proc/PID/task. */
- char task_dir[sizeof("/proc/%u/task") + sizeof(int)*3];
- sprintf(task_dir, "/proc/%u/task", pid);
- sp->task_dir = xopendir(task_dir);
+ sprintf(filename, "/proc/%u/task", pid);
+ /* Note: if opendir fails, we just go to next /proc/XXX */
+ sp->task_dir = opendir(filename);
sp->main_thread_pid = pid;
continue;
}
@@ -347,9 +345,15 @@
}
#endif
- filename_tail = filename + sprintf(filename, "/proc/%u/", pid);
+#if ENABLE_FEATURE_SHOW_THREADS
+ if (sp->task_dir)
+ filename_tail = filename + sprintf(filename, "/proc/%u/task/%u/", sp->main_thread_pid, pid);
+ else
+#endif
+ filename_tail = filename + sprintf(filename, "/proc/%u/", pid);
if (flags & PSSCAN_UIDGID) {
+ struct stat sb;
if (stat(filename, &sb))
continue; /* process probably exited */
/* Effective UID/GID, not real */
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/libbb/udp_io.c
^
|
@@ -13,7 +13,7 @@
* We don't check for errors here. Not supported == won't be used
*/
void FAST_FUNC
-socket_want_pktinfo(int fd)
+socket_want_pktinfo(int fd UNUSED_PARAM)
{
#ifdef IP_PKTINFO
setsockopt(fd, IPPROTO_IP, IP_PKTINFO, &const_int_1, sizeof(int));
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/loginutils/chpasswd.c
^
|
@@ -33,9 +33,8 @@
int chpasswd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int chpasswd_main(int argc UNUSED_PARAM, char **argv)
{
- char *name, *pass;
- char salt[sizeof("$N$XXXXXXXX")];
- int opt, rc;
+ char *name;
+ int opt;
if (getuid() != 0)
bb_error_msg_and_die(bb_msg_perm_denied_are_you_root);
@@ -45,6 +44,10 @@
opt = getopt32(argv, "em");
while ((name = xmalloc_fgetline(stdin)) != NULL) {
+ char *free_me;
+ char *pass;
+ int rc;
+
pass = strchr(name, ':');
if (!pass)
bb_error_msg_and_die("missing new password");
@@ -52,7 +55,10 @@
xuname2uid(name); /* dies if there is no such user */
+ free_me = NULL;
if (!(opt & OPT_ENC)) {
+ char salt[sizeof("$N$XXXXXXXX")];
+
crypt_make_salt(salt, 1);
if (opt & OPT_MD5) {
salt[0] = '$';
@@ -60,7 +66,7 @@
salt[2] = '$';
crypt_make_salt(salt + 3, 4);
}
- pass = pw_encrypt(pass, salt, 0);
+ free_me = pass = pw_encrypt(pass, salt, 0);
}
/* This is rather complex: if user is not found in /etc/shadow,
@@ -81,8 +87,7 @@
bb_info_msg("Password for '%s' changed", name);
logmode = LOGMODE_STDIO;
free(name);
- if (!(opt & OPT_ENC))
- free(pass);
+ free(free_me);
}
return EXIT_SUCCESS;
}
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/miscutils/crond.c
^
|
@@ -861,7 +861,8 @@
/* "-b after -f is ignored", and so on for every pair a-b */
opt_complementary = "f-b:b-f:S-L:L-S" IF_FEATURE_CROND_D(":d-l")
- ":l+:d+"; /* -l and -d have numeric param */
+ /* -l and -d have numeric param */
+ ":l+" IF_FEATURE_CROND_D(":d+");
opts = getopt32(argv, "l:L:fbSc:" IF_FEATURE_CROND_D("d:"),
&G.log_level, &G.log_filename, &G.crontab_dir_name
IF_FEATURE_CROND_D(,&G.log_level));
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/miscutils/less.c
^
|
@@ -721,8 +721,8 @@
while (match_status == 0) {
char *new = xasprintf("%s%.*s"HIGHLIGHT"%.*s"NORMAL,
growline ? growline : "",
- match_structs.rm_so, str,
- match_structs.rm_eo - match_structs.rm_so,
+ (int)match_structs.rm_so, str,
+ (int)(match_structs.rm_eo - match_structs.rm_so),
str + match_structs.rm_so);
free(growline);
growline = new;
@@ -990,7 +990,8 @@
*/
if (key >= 0 && key < ' ' && key != 0x0d && key != 8)
goto again;
- return key;
+
+ return key64;
}
static char* less_gets(int sz)
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/networking/inetd.c
^
|
@@ -1278,6 +1278,7 @@
sep->se_count = 0;
rearm_alarm(); /* will revive it in RETRYTIME sec */
restore_sigmask(&omask);
+ maybe_close(new_udp_fd);
maybe_close(accepted_fd);
continue; /* -> check next fd in fd set */
}
@@ -1298,17 +1299,18 @@
bb_perror_msg("vfork"+1);
sleep(1);
restore_sigmask(&omask);
+ maybe_close(new_udp_fd);
maybe_close(accepted_fd);
continue; /* -> check next fd in fd set */
}
if (pid == 0)
pid--; /* -1: "we did fork and we are child" */
}
- /* if pid == 0 here, we never forked */
+ /* if pid == 0 here, we didn't fork */
if (pid > 0) { /* parent */
if (sep->se_wait) {
- /* tcp wait: we passed listening socket to child,
+ /* wait: we passed socket to child,
* will wait for child to terminate */
sep->se_wait = pid;
remove_fd_from_set(sep->se_fd);
@@ -1345,9 +1347,13 @@
setsid();
/* "nowait" udp */
if (new_udp_fd >= 0) {
- len_and_sockaddr *lsa = xzalloc_lsa(sep->se_family);
+ len_and_sockaddr *lsa;
+ int r;
+
+ close(new_udp_fd);
+ lsa = xzalloc_lsa(sep->se_family);
/* peek at the packet and remember peer addr */
- int r = recvfrom(ctrl, NULL, 0, MSG_PEEK|MSG_DONTWAIT,
+ r = recvfrom(ctrl, NULL, 0, MSG_PEEK|MSG_DONTWAIT,
&lsa->u.sa, &lsa->len);
if (r < 0)
goto do_exit1;
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/networking/tftp.c
^
|
@@ -813,7 +813,8 @@
goto err;
}
mode = local_file + strlen(local_file) + 1;
- if (mode >= block_buf + result || strcmp(mode, "octet") != 0) {
+ /* RFC 1350 says mode string is case independent */
+ if (mode >= block_buf + result || strcasecmp(mode, "octet") != 0) {
goto err;
}
# if ENABLE_FEATURE_TFTP_BLOCKSIZE
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/shell/cttyhack.c
^
|
@@ -122,10 +122,12 @@
do {
#ifdef __linux__
int s = open_read_close("/sys/class/tty/console/active",
- console + 5, sizeof(console) - 5 - 1);
+ console + 5, sizeof(console) - 5);
if (s > 0) {
- /* found active console via sysfs (Linux 2.6.38+) */
- console[5 + s] = '\0';
+ /* found active console via sysfs (Linux 2.6.38+)
+ * sysfs string looks like "ttyS0\n" so zap the newline:
+ */
+ console[4 + s] = '\0';
break;
}
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/shell/hush.c
^
|
@@ -7817,20 +7817,24 @@
#if ENABLE_FEATURE_EDITING
G.line_input_state = new_line_input_t(FOR_SHELL);
-# if defined MAX_HISTORY && MAX_HISTORY > 0 && ENABLE_HUSH_SAVEHISTORY
+# if MAX_HISTORY > 0 && ENABLE_HUSH_SAVEHISTORY
{
const char *hp = get_local_var_value("HISTFILE");
if (!hp) {
hp = get_local_var_value("HOME");
- if (hp) {
- G.line_input_state->hist_file = concat_path_file(hp, ".hush_history");
- //set_local_var(xasprintf("HISTFILE=%s", ...));
- }
+ if (hp)
+ hp = concat_path_file(hp, ".hush_history");
+ } else {
+ hp = xstrdup(hp);
}
-# if ENABLE_FEATURE_SH_HISTFILESIZE
+ if (hp) {
+ G.line_input_state->hist_file = hp;
+ //set_local_var(xasprintf("HISTFILE=%s", ...));
+ }
+# if ENABLE_FEATURE_SH_HISTFILESIZE
hp = get_local_var_value("HISTFILESIZE");
G.line_input_state->max_history = size_from_HISTFILESIZE(hp);
-# endif
+# endif
}
# endif
#endif
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/sysklogd/syslogd.c
^
|
@@ -278,7 +278,7 @@
parser_t *parser;
parser = config_open2(file ? file : "/etc/syslog.conf",
- file ? xfopen_for_read : fopen_or_warn_stdin);
+ file ? xfopen_for_read : fopen_for_read);
if (!parser)
/* didn't find default /etc/syslog.conf */
/* proceed as if we built busybox without config support */
@@ -594,6 +594,14 @@
}
/* newFile == "f.0" now */
rename(log_file->path, newFile);
+ /* Incredibly, if F and F.0 are hardlinks, POSIX
+ * _demands_ that rename returns 0 but does not
+ * remove F!!!
+ * (hardlinked F/F.0 pair was observed after
+ * power failure during rename()).
+ * Ensure old file is gone:
+ */
+ unlink(log_file->path);
#ifdef SYSLOGD_WRLOCK
fl.l_type = F_UNLCK;
fcntl(log_file->fd, F_SETLKW, &fl);
@@ -678,7 +686,7 @@
if (LOG_PRI(pri) < G.logLevel) {
#if ENABLE_FEATURE_IPC_SYSLOG
if ((option_mask32 & OPT_circularlog) && G.shbuf) {
- log_to_shmem(msg);
+ log_to_shmem(G.printbuf);
return;
}
#endif
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/testsuite/sed.tests
^
|
@@ -6,7 +6,7 @@
. ./testing.sh
-# testing "description" "arguments" "result" "infile" "stdin"
+# testing "description" "commands" "result" "infile" "stdin"
# Corner cases
testing "sed no files (stdin)" 'sed ""' "hello\n" "" "hello\n"
@@ -225,7 +225,7 @@
#testing "sed -g (exhaustive)" "sed -e 's/[[:space:]]*/,/g'" ",1,2,3,4,5," \
# "" "12345"
-# testing "description" "arguments" "result" "infile" "stdin"
+# testing "description" "commands" "result" "infile" "stdin"
testing "sed n command must reset 'substituted' bit" \
"sed 's/1/x/;T;n;: next;s/3/y/;t quit;n;b next;: quit;q'" \
@@ -291,6 +291,10 @@
"sed 's/r/\r/'" \
"\rrr\n" "" "rrr\n"
-# testing "description" "arguments" "result" "infile" "stdin"
+testing "sed -i finishes ranges correctly" \
+ "sed '1,2d' -i input; echo \$?; cat input" \
+ "0\n3\n4\n" "1\n2\n3\n4\n" ""
+
+# testing "description" "commands" "result" "infile" "stdin"
exit $FAILCOUNT
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/testsuite/tail.tests
^
|
@@ -14,4 +14,12 @@
"0\n" \
"" "qw"
+testing "tail: -c +N with largish N" \
+ "
+ dd if=/dev/zero bs=16k count=1 2>/dev/null | tail -c +8200 | wc -c;
+ dd if=/dev/zero bs=16k count=1 2>/dev/null | tail -c +8208 | wc -c;
+ " \
+ "8185\n8177\n" \
+ "" ""
+
exit $FAILCOUNT
|
[-]
[+]
|
Changed |
busybox-1.19.3.tar.bz2/util-linux/swaponoff.c
^
|
@@ -114,7 +114,8 @@
#if !ENABLE_FEATURE_SWAPON_PRI
ret = getopt32(argv, "a");
#else
- opt_complementary = "p+";
+ if (applet_name[5] == 'n')
+ opt_complementary = "p+";
ret = getopt32(argv, (applet_name[5] == 'n') ? "ap:" : "a", &g_flags);
if (ret & 2) { // -p
|