From 97c6491b4edf4bc9db293533ae0c3a81c4ef07f7 Mon Sep 17 00:00:00 2001 From: Maninder Singh Date: Mon, 25 May 2015 13:46:36 +0200 Subject: typo fixes Signed-off-by: Maninder Singh Signed-off-by: Denys Vlasenko --- shell/hush.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shell') diff --git a/shell/hush.c b/shell/hush.c index f2c0a70f2..96c739fb7 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -442,7 +442,7 @@ enum { MAYBE_ASSIGNMENT = 0, DEFINITELY_ASSIGNMENT = 1, NOT_ASSIGNMENT = 2, - /* Not an assigment, but next word may be: "if v=xyz cmd;" */ + /* Not an assignment, but next word may be: "if v=xyz cmd;" */ WORD_IS_KEYWORD = 3, }; /* Used for initialization: o_string foo = NULL_O_STRING; */ -- cgit v1.2.3-55-g6feb From 97f2f7ca7fe10783a592087df989a7f394492fa1 Mon Sep 17 00:00:00 2001 From: Maninder Singh Date: Wed, 10 Jun 2015 03:47:27 +0000 Subject: Removes stray empty line from code This patch removes stray empty line from busybox code reported by script find_stray_empty_lines Signed-off-by: Maninder Singh Signed-off-by: Akhilesh Kumar Signed-off-by: Denys Vlasenko --- archival/cpio.c | 1 - archival/gzip.c | 3 --- archival/libarchive/bz/compress.c | 1 - archival/libarchive/decompress_uncompress.c | 1 - archival/libarchive/lzo1x_9x.c | 1 - archival/libarchive/unxz/xz_dec_lzma2.c | 3 --- archival/libarchive/unxz/xz_dec_stream.c | 2 -- archival/unzip.c | 2 -- console-tools/showkey.c | 1 - coreutils/ln.c | 1 - editors/awk.c | 12 ------------ editors/ed.c | 1 - editors/vi.c | 1 - libbb/appletlib.c | 1 - libbb/in_ether.c | 1 - libbb/procps.c | 1 - libbb/xfuncs.c | 1 - mailutils/reformime.c | 1 - miscutils/crontab.c | 1 - networking/arp.c | 1 - networking/ntpd.c | 1 - networking/tftp.c | 1 - networking/wget.c | 1 - selinux/setfiles.c | 1 - shell/ash.c | 2 -- shell/hush.c | 1 - shell/shell_common.c | 1 - sysklogd/syslogd.c | 1 - 28 files changed, 46 deletions(-) (limited to 'shell') diff --git a/archival/cpio.c b/archival/cpio.c index 454648d68..cdc16c14e 100644 --- a/archival/cpio.c +++ b/archival/cpio.c @@ -257,7 +257,6 @@ static NOINLINE int cpio_o(void) free(line); continue; } - } else { /* line == NULL: EOF */ next_link: if (links) { diff --git a/archival/gzip.c b/archival/gzip.c index 42b2f0b2e..c9171304a 100644 --- a/archival/gzip.c +++ b/archival/gzip.c @@ -1372,7 +1372,6 @@ static void build_tree(tree_desc * desc) /* and insert the new node in the heap */ G2.heap[SMALLEST] = node++; pqdownheap(tree, SMALLEST); - } while (G2.heap_len >= 2); G2.heap[--G2.heap_max] = G2.heap[SMALLEST]; @@ -1720,7 +1719,6 @@ static ulg flush_block(char *buf, ulg stored_len, int eof) copy_block(buf, (unsigned) stored_len, 0); /* without header */ G2.compressed_len = stored_len << 3; - } else if (stored_len + 4 <= opt_lenb && buf != NULL) { /* 4: two words for the lengths */ /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. @@ -1734,7 +1732,6 @@ static ulg flush_block(char *buf, ulg stored_len, int eof) G2.compressed_len += (stored_len + 4) << 3; copy_block(buf, (unsigned) stored_len, 1); /* with header */ - } else if (static_lenb == opt_lenb) { send_bits((STATIC_TREES << 1) + eof, 3); compress_block((ct_data *) G2.static_ltree, (ct_data *) G2.static_dtree); diff --git a/archival/libarchive/bz/compress.c b/archival/libarchive/bz/compress.c index 23de9d3f5..2d994685c 100644 --- a/archival/libarchive/bz/compress.c +++ b/archival/libarchive/bz/compress.c @@ -385,7 +385,6 @@ void sendMTFValues(EState* s) cost[0] = cost01 & 0xffff; cost[1] = cost01 >> 16; cost[2] = cost23 & 0xffff; cost[3] = cost23 >> 16; cost[4] = cost45 & 0xffff; cost[5] = cost45 >> 16; - } else #endif { diff --git a/archival/libarchive/decompress_uncompress.c b/archival/libarchive/decompress_uncompress.c index 496d864a7..034ed502d 100644 --- a/archival/libarchive/decompress_uncompress.c +++ b/archival/libarchive/decompress_uncompress.c @@ -297,7 +297,6 @@ unpack_Z_stream(transformer_state_t *xstate) /* Remember previous code. */ oldcode = incode; } - } while (rsize > 0); if (outpos > 0) { diff --git a/archival/libarchive/lzo1x_9x.c b/archival/libarchive/lzo1x_9x.c index 2b490ae83..09ee4ba5c 100644 --- a/archival/libarchive/lzo1x_9x.c +++ b/archival/libarchive/lzo1x_9x.c @@ -71,7 +71,6 @@ typedef struct { uint8_t *out; unsigned r1_lit; - } lzo1x_999_t; #define getbyte(c) ((c).ip < (c).in_end ? *((c).ip)++ : (-1)) diff --git a/archival/libarchive/unxz/xz_dec_lzma2.c b/archival/libarchive/unxz/xz_dec_lzma2.c index 3c2dc88b7..351251f7c 100644 --- a/archival/libarchive/unxz/xz_dec_lzma2.c +++ b/archival/libarchive/unxz/xz_dec_lzma2.c @@ -995,10 +995,8 @@ XZ_EXTERN NOINLINE enum xz_ret XZ_FUNC xz_dec_lzma2_run( s->lzma2.need_props = false; s->lzma2.next_sequence = SEQ_PROPERTIES; - } else if (s->lzma2.need_props) { return XZ_DATA_ERROR; - } else { s->lzma2.next_sequence = SEQ_LZMA_PREPARE; @@ -1080,7 +1078,6 @@ XZ_EXTERN NOINLINE enum xz_ret XZ_FUNC xz_dec_lzma2_run( rc_reset(&s->rc); s->lzma2.sequence = SEQ_CONTROL; - } else if (b->out_pos == b->out_size || (b->in_pos == b->in_size && s->temp.size diff --git a/archival/libarchive/unxz/xz_dec_stream.c b/archival/libarchive/unxz/xz_dec_stream.c index bdcbf1ba3..bf791055b 100644 --- a/archival/libarchive/unxz/xz_dec_stream.c +++ b/archival/libarchive/unxz/xz_dec_stream.c @@ -353,7 +353,6 @@ static enum xz_ret XZ_FUNC crc32_validate(struct xz_dec *s, struct xz_buf *b) return XZ_DATA_ERROR; s->pos += 8; - } while (s->pos < 32); s->crc32 = 0; @@ -753,7 +752,6 @@ XZ_EXTERN enum xz_ret XZ_FUNC xz_dec_run(struct xz_dec *s, struct xz_buf *b) b->in_pos = in_start; b->out_pos = out_start; } - } else if (ret == XZ_OK && in_start == b->in_pos && out_start == b->out_pos) { if (s->allow_buf_error) diff --git a/archival/unzip.c b/archival/unzip.c index eed225677..f41ab6f44 100644 --- a/archival/unzip.c +++ b/archival/unzip.c @@ -604,7 +604,6 @@ int unzip_main(int argc, char **argv) || (zaccept && !find_list_entry(zaccept, dst_fn)) ) { /* Skip entry */ i = 'n'; - } else { if (listing) { /* List entry */ @@ -666,7 +665,6 @@ int unzip_main(int argc, char **argv) } } i = 'n'; - } else { /* Extract file */ check_file: diff --git a/console-tools/showkey.c b/console-tools/showkey.c index 69b785ec6..b7b4c32a8 100644 --- a/console-tools/showkey.c +++ b/console-tools/showkey.c @@ -83,7 +83,6 @@ int showkey_main(int argc UNUSED_PARAM, char **argv) if (04 /*CTRL-D*/ == c) break; } - } else { // we assume a PC keyboard xioctl(STDIN_FILENO, KDGKBMODE, &kbmode); diff --git a/coreutils/ln.c b/coreutils/ln.c index 3b822e8c7..168814801 100644 --- a/coreutils/ln.c +++ b/coreutils/ln.c @@ -134,7 +134,6 @@ int ln_main(int argc, char **argv) } free(src_name); - } while ((++argv)[1]); return status; diff --git a/editors/awk.c b/editors/awk.c index f487163af..9c6819ad2 100644 --- a/editors/awk.c +++ b/editors/awk.c @@ -1060,12 +1060,10 @@ static uint32_t next_token(uint32_t expected) if (t_rollback) { t_rollback = FALSE; - } else if (concat_inserted) { concat_inserted = FALSE; t_tclass = save_tclass; t_info = save_info; - } else { p = g_pos; readnext: @@ -1081,7 +1079,6 @@ static uint32_t next_token(uint32_t expected) if (*p == '\0') { tc = TC_EOF; debug_printf_parse("%s: token found: TC_EOF\n", __func__); - } else if (*p == '\"') { /* it's a string */ t_string = s = ++p; @@ -1097,7 +1094,6 @@ static uint32_t next_token(uint32_t expected) *s = '\0'; tc = TC_STRING; debug_printf_parse("%s: token found:'%s' TC_STRING\n", __func__, t_string); - } else if ((expected & TC_REGEXP) && *p == '/') { /* it's regexp */ t_string = s = ++p; @@ -1130,7 +1126,6 @@ static uint32_t next_token(uint32_t expected) syntax_error(EMSG_UNEXP_TOKEN); tc = TC_NUMBER; debug_printf_parse("%s: token found:%f TC_NUMBER\n", __func__, t_double); - } else { /* search for something known */ tl = tokenlist; @@ -1580,12 +1575,10 @@ static void parse_program(char *p) debug_printf_parse("%s: TC_BEGIN\n", __func__); seq = &beginseq; chain_group(); - } else if (tclass & TC_END) { debug_printf_parse("%s: TC_END\n", __func__); seq = &endseq; chain_group(); - } else if (tclass & TC_FUNCDECL) { debug_printf_parse("%s: TC_FUNCDECL\n", __func__); next_token(TC_FUNCTION); @@ -1603,7 +1596,6 @@ static void parse_program(char *p) seq = &f->body; chain_group(); clear_array(ahash); - } else if (tclass & TC_OPSEQ) { debug_printf_parse("%s: TC_OPSEQ\n", __func__); rollback_token(); @@ -1618,7 +1610,6 @@ static void parse_program(char *p) chain_node(OC_PRINT); } cn->r.n = mainseq.last; - } else /* if (tclass & TC_GRPSTART) */ { debug_printf_parse("%s: TC_GRPSTART(?)\n", __func__); rollback_token(); @@ -1879,13 +1870,10 @@ static void handle_special(var *v) split_f0(); mk_splitter(getvar_s(v), &fsplitter); - } else if (v == intvar[RS]) { mk_splitter(getvar_s(v), &rsplitter); - } else if (v == intvar[IGNORECASE]) { icase = istrue(v); - } else { /* $n */ n = getvar_i(intvar[NF]); setvar_i(intvar[NF], n > v-Fields ? n : v-Fields+1); diff --git a/editors/ed.c b/editors/ed.c index 3087fb0b9..f0e5e4d5d 100644 --- a/editors/ed.c +++ b/editors/ed.c @@ -732,7 +732,6 @@ static int readLines(const char *file, int num) cc = safe_read(fd, bufPtr, bufSize - bufUsed); bufUsed += cc; bufPtr = bufBase; - } while (cc > 0); if (cc < 0) { diff --git a/editors/vi.c b/editors/vi.c index 6ce513c0c..3db597ae1 100644 --- a/editors/vi.c +++ b/editors/vi.c @@ -411,7 +411,6 @@ struct globals { char undo_text[1]; // text that was deleted (if deletion) } *undo_stack_tail; #endif /* ENABLE_FEATURE_VI_UNDO */ - }; #define G (*ptr_to_globals) #define text (G.text ) diff --git a/libbb/appletlib.c b/libbb/appletlib.c index 46849e4f0..24253cf27 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c @@ -457,7 +457,6 @@ static void parse_config_file(void) errmsg = "keyword outside section"; goto pe_label; } - } /* while (1) */ pe_label: diff --git a/libbb/in_ether.c b/libbb/in_ether.c index 1de383bde..161c8ea3c 100644 --- a/libbb/in_ether.c +++ b/libbb/in_ether.c @@ -51,7 +51,6 @@ int FAST_FUNC in_ether(const char *bufp, struct sockaddr *sap) } while (j); *ptr++ = val; - } while (--i); /* Error if we aren't at end of string */ diff --git a/libbb/procps.c b/libbb/procps.c index 948b91ee6..3d335b37b 100644 --- a/libbb/procps.c +++ b/libbb/procps.c @@ -614,7 +614,6 @@ void FAST_FUNC read_cmdline(char *buf, int col, unsigned pid, const char *comm) buf[comm_len - 1] = ' '; buf[col - 1] = '\0'; } - } else { snprintf(buf, col, "[%s]", comm); } diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c index f25ce9446..0c9969640 100644 --- a/libbb/xfuncs.c +++ b/libbb/xfuncs.c @@ -207,7 +207,6 @@ off_t FAST_FUNC fdlength(int fd) else bottom = pos; // If we can't, it's smaller. - } else { if (bottom == top) { if (!top) return 0; diff --git a/mailutils/reformime.c b/mailutils/reformime.c index 8e7d455f6..86b2cfed3 100644 --- a/mailutils/reformime.c +++ b/mailutils/reformime.c @@ -134,7 +134,6 @@ static int parse(const char *boundary, char **argv) if (strcasecmp(type + 10, "mixed") != 0) bb_error_msg_and_die("no support of content type '%s'", type); parse(xfind_token(tokens, "boundary"), argv); - } else { /* No, process one non-multipart section */ char *end; diff --git a/miscutils/crontab.c b/miscutils/crontab.c index aad242fd8..85c6623b2 100644 --- a/miscutils/crontab.c +++ b/miscutils/crontab.c @@ -170,7 +170,6 @@ int crontab_main(int argc UNUSED_PARAM, char **argv) unlink(tmp_fname); /*free(tmp_fname);*/ /*free(new_fname);*/ - } /* switch */ /* Bump notification file. Handle window where crond picks file up diff --git a/networking/arp.c b/networking/arp.c index e79b1b6a1..0099aa534 100644 --- a/networking/arp.c +++ b/networking/arp.c @@ -68,7 +68,6 @@ struct globals { const struct hwtype *hw; /* current hardware type */ const char *device; /* current device */ smallint hw_set; /* flag if hw-type was set (-H) */ - } FIX_ALIASING; #define G (*(struct globals*)&bb_common_bufsiz1) #define ap (G.ap ) diff --git a/networking/ntpd.c b/networking/ntpd.c index 0233ed82c..b5120a70d 100644 --- a/networking/ntpd.c +++ b/networking/ntpd.c @@ -1497,7 +1497,6 @@ update_local_clock(peer_t *p) #endif abs_offset = offset = 0; set_new_values(STATE_SYNC, offset, recv_time); - } else { /* abs_offset <= STEP_THRESHOLD */ /* The ratio is calculated before jitter is updated to make diff --git a/networking/tftp.c b/networking/tftp.c index 7c0ee58d7..8ecd7bb6f 100644 --- a/networking/tftp.c +++ b/networking/tftp.c @@ -348,7 +348,6 @@ static int tftp_protocol( * as if it is "block 0" */ block_nr = 0; } - } else { /* tftp */ /* Open file (must be after changing user) */ local_fd = CMD_GET(option_mask32) ? STDOUT_FILENO : STDIN_FILENO; diff --git a/networking/wget.c b/networking/wget.c index 6c8bd90a8..f744ea2de 100644 --- a/networking/wget.c +++ b/networking/wget.c @@ -1050,7 +1050,6 @@ However, in real world it was observed that some web servers /* For HTTP, data is pumped over the same connection */ dfp = sfp; - } else { /* * FTP session diff --git a/selinux/setfiles.c b/selinux/setfiles.c index 0173db99e..c974c4a9d 100644 --- a/selinux/setfiles.c +++ b/selinux/setfiles.c @@ -251,7 +251,6 @@ static int match(const char *name, struct stat *sb, char **con) name = path; if (excludeCtr > 0 && exclude(name)) goto err; - } else { char *p; p = realpath(name, path); diff --git a/shell/ash.c b/shell/ash.c index 282f761fc..4c01e67d4 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -9447,7 +9447,6 @@ evalcommand(union node *cmd, int flags) if (evalfun(cmdentry.u.func, argc, argv, flags)) goto raise; break; - } /* switch */ out: @@ -11763,7 +11762,6 @@ parsearith: { goto parsearith_return; } #endif - } /* end of readtoken */ /* diff --git a/shell/hush.c b/shell/hush.c index 96c739fb7..3ca04494c 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -5390,7 +5390,6 @@ static NOINLINE int expand_vars_to_list(o_string *output, int n, char *arg) !!(output->o_expflags & EXP_FLAG_ESC_GLOB_CHARS)); } break; - } /* switch (char after ) */ if (val && val[0]) { diff --git a/shell/shell_common.c b/shell/shell_common.c index 57297155e..2b6f7dc92 100644 --- a/shell/shell_common.c +++ b/shell/shell_common.c @@ -493,7 +493,6 @@ shell_builtin_ulimit(char **argv) /* bad option. getopt already complained. */ break; } - } /* while (there are options) */ return 0; diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index 266657f3b..156f487e5 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c @@ -237,7 +237,6 @@ enum { OPT_dup = IF_FEATURE_SYSLOGD_DUP( (1 << OPTBIT_dup )) + 0, OPT_cfg = IF_FEATURE_SYSLOGD_CFG( (1 << OPTBIT_cfg )) + 0, OPT_kmsg = IF_FEATURE_KMSG_SYSLOG( (1 << OPTBIT_kmsg )) + 0, - }; #define OPTION_STR "m:nO:l:S" \ IF_FEATURE_ROTATE_LOGFILE("s:" ) \ -- cgit v1.2.3-55-g6feb From 0e056f7e9efcebbbb85444221e141b37d3ab79e6 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Wed, 1 Jul 2015 16:45:40 +0100 Subject: ash: remove parsebackquote flag Commit 503a0b8 from git://git.kernel.org/pub/scm/utils/dash/dash.git by Herbert Xu says: >The parsebackquote flag is only used in a test where it always has the >value zero. So we can remove it altogether. The first statement is incorrect: parsebackquote is non-zero when backquotes (as opposed to $(...)) are used for command substitution. It is possible for the test to be executed with parsebackquote != 0 in that case. The test is question checks whether quotes have been closed, raising the error "unterminated quoted string" if they haven't. There seems to be no good reason to allow unclosed quotes within backquotes. Bash, hush and dash (after commit 503a0b8) all treat the following as an error: XX=`"pwd` whereas BusyBox ash doesn't. It just ignores the unclosed quote and executes pwd. So, parsebackquote should be removed but not for the reason stated. function old new delta parsebackquote 1 - -1 readtoken1 3222 3182 -40 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-41) Total: -41 bytes Signed-off-by: Ron Yorston Signed-off-by: Denys Vlasenko --- shell/ash.c | 8 +------- shell/ash_test/ash-misc/tickquote1.right | 1 + shell/ash_test/ash-misc/tickquote1.tests | 1 + 3 files changed, 3 insertions(+), 7 deletions(-) create mode 100644 shell/ash_test/ash-misc/tickquote1.right create mode 100755 shell/ash_test/ash-misc/tickquote1.tests (limited to 'shell') diff --git a/shell/ash.c b/shell/ash.c index 4c01e67d4..6627cec9b 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -10473,7 +10473,6 @@ struct heredoc { }; static smallint tokpushback; /* last token pushed back */ -static smallint parsebackquote; /* nonzero if we are inside backquotes */ static smallint quoteflag; /* set if (part of) last token was quoted */ static token_id_t lasttoken; /* last token read (integer id Txxx) */ static struct heredoc *heredoclist; /* list of here documents to read */ @@ -11313,7 +11312,7 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs) if (syntax == ARISYNTAX) raise_error_syntax("missing '))'"); #endif - if (syntax != BASESYNTAX && !parsebackquote && eofmark == NULL) + if (syntax != BASESYNTAX && eofmark == NULL) raise_error_syntax("unterminated quoted string"); if (varnest != 0) { startlinno = g_parsefile->linno; @@ -11609,7 +11608,6 @@ parsesub: { */ parsebackq: { struct nodelist **nlpp; - smallint savepbq; union node *n; char *volatile str; struct jmploc jmploc; @@ -11620,10 +11618,8 @@ parsebackq: { #ifdef __GNUC__ (void) &saveprompt; #endif - savepbq = parsebackquote; if (setjmp(jmploc.loc)) { free(str); - parsebackquote = 0; exception_handler = savehandler; longjmp(exception_handler->loc, 1); } @@ -11707,7 +11703,6 @@ parsebackq: { nlpp = &(*nlpp)->next; *nlpp = stzalloc(sizeof(**nlpp)); /* (*nlpp)->next = NULL; - stzalloc did it */ - parsebackquote = oldstyle; if (oldstyle) { saveprompt = doprompt; @@ -11741,7 +11736,6 @@ parsebackq: { str = NULL; INT_ON; } - parsebackquote = savepbq; exception_handler = savehandler; USTPUTC(CTLBACKQ, out); if (oldstyle) diff --git a/shell/ash_test/ash-misc/tickquote1.right b/shell/ash_test/ash-misc/tickquote1.right new file mode 100644 index 000000000..2e661bfe3 --- /dev/null +++ b/shell/ash_test/ash-misc/tickquote1.right @@ -0,0 +1 @@ +./tickquote1.tests: line 1: syntax error: unterminated quoted string diff --git a/shell/ash_test/ash-misc/tickquote1.tests b/shell/ash_test/ash-misc/tickquote1.tests new file mode 100755 index 000000000..90d5bbc9b --- /dev/null +++ b/shell/ash_test/ash-misc/tickquote1.tests @@ -0,0 +1 @@ +echo `"pwd` -- cgit v1.2.3-55-g6feb From f54a487bb4d36a4318c5ec539f8265fdff2cac90 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 13 Jul 2015 03:52:32 +0200 Subject: fix file mode Signed-off-by: Denys Vlasenko --- shell/ash_test/ash-misc/echo_write_error.tests | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 shell/ash_test/ash-misc/echo_write_error.tests (limited to 'shell') diff --git a/shell/ash_test/ash-misc/echo_write_error.tests b/shell/ash_test/ash-misc/echo_write_error.tests old mode 100644 new mode 100755 -- cgit v1.2.3-55-g6feb From 072fc60f29ee3a4ff38f095a9ef149b2e820c8c0 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Wed, 1 Jul 2015 16:46:18 +0100 Subject: ash: use alloca to get rid of setjmp Now that the only thing protected by setjmp/longjmp is the saved string, we can allocate it on the stack to get rid of the jump. Based on commit bd35d8e from git://git.kernel.org/pub/scm/utils/dash/dash.git by Herbert Xu. function old new delta readtoken1 3182 3116 -66 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-66) Total: -66 bytes Signed-off-by: Ron Yorston Signed-off-by: Denys Vlasenko --- shell/ash.c | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) (limited to 'shell') diff --git a/shell/ash.c b/shell/ash.c index 6627cec9b..f4779ee2b 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -11132,19 +11132,6 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs) IF_ASH_BASH_COMPAT(smallint bash_dollar_squote = 0;) -#if __GNUC__ - /* Avoid longjmp clobbering */ - (void) &out; - (void) "ef; - (void) &dblquote; - (void) &varnest; - (void) &arinest; - (void) &parenlevel; - (void) &dqvarnest; - (void) &oldstyle; - (void) &prevsyntax; - (void) &syntax; -#endif startlinno = g_parsefile->linno; bqlist = NULL; quotef = 0; @@ -11609,30 +11596,16 @@ parsesub: { parsebackq: { struct nodelist **nlpp; union node *n; - char *volatile str; - struct jmploc jmploc; - struct jmploc *volatile savehandler; + char *str; size_t savelen; smallint saveprompt = 0; -#ifdef __GNUC__ - (void) &saveprompt; -#endif - if (setjmp(jmploc.loc)) { - free(str); - exception_handler = savehandler; - longjmp(exception_handler->loc, 1); - } - INT_OFF; str = NULL; savelen = out - (char *)stackblock(); if (savelen > 0) { - str = ckmalloc(savelen); + str = alloca(savelen); memcpy(str, stackblock(), savelen); } - savehandler = exception_handler; - exception_handler = &jmploc; - INT_ON; if (oldstyle) { /* We must read until the closing backquote, giving special * treatment to some slashes, and then push the string and @@ -11731,12 +11704,7 @@ parsebackq: { if (str) { memcpy(out, str, savelen); STADJUST(savelen, out); - INT_OFF; - free(str); - str = NULL; - INT_ON; } - exception_handler = savehandler; USTPUTC(CTLBACKQ, out); if (oldstyle) goto parsebackq_oldreturn; -- cgit v1.2.3-55-g6feb