aboutsummaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c46
1 files changed, 3 insertions, 43 deletions
diff --git a/shell/ash.c b/shell/ash.c
index c5b9741d6..ef3f7933a 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -9888,7 +9888,6 @@ evalcommand(union node *cmd, int flags)
9888 if (evalfun(cmdentry.u.func, argc, argv, flags)) 9888 if (evalfun(cmdentry.u.func, argc, argv, flags))
9889 goto raise; 9889 goto raise;
9890 break; 9890 break;
9891
9892 } /* switch */ 9891 } /* switch */
9893 9892
9894 out: 9893 out:
@@ -10917,7 +10916,6 @@ struct heredoc {
10917}; 10916};
10918 10917
10919static smallint tokpushback; /* last token pushed back */ 10918static smallint tokpushback; /* last token pushed back */
10920static smallint parsebackquote; /* nonzero if we are inside backquotes */
10921static smallint quoteflag; /* set if (part of) last token was quoted */ 10919static smallint quoteflag; /* set if (part of) last token was quoted */
10922static token_id_t lasttoken; /* last token read (integer id Txxx) */ 10920static token_id_t lasttoken; /* last token read (integer id Txxx) */
10923static struct heredoc *heredoclist; /* list of here documents to read */ 10921static struct heredoc *heredoclist; /* list of here documents to read */
@@ -11577,19 +11575,6 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs)
11577 11575
11578 IF_ASH_BASH_COMPAT(smallint bash_dollar_squote = 0;) 11576 IF_ASH_BASH_COMPAT(smallint bash_dollar_squote = 0;)
11579 11577
11580#if __GNUC__
11581 /* Avoid longjmp clobbering */
11582 (void) &out;
11583 (void) &quotef;
11584 (void) &dblquote;
11585 (void) &varnest;
11586 (void) &arinest;
11587 (void) &parenlevel;
11588 (void) &dqvarnest;
11589 (void) &oldstyle;
11590 (void) &prevsyntax;
11591 (void) &syntax;
11592#endif
11593 startlinno = g_parsefile->linno; 11578 startlinno = g_parsefile->linno;
11594 bqlist = NULL; 11579 bqlist = NULL;
11595 quotef = 0; 11580 quotef = 0;
@@ -11757,7 +11742,7 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs)
11757 if (syntax == ARISYNTAX) 11742 if (syntax == ARISYNTAX)
11758 raise_error_syntax("missing '))'"); 11743 raise_error_syntax("missing '))'");
11759#endif 11744#endif
11760 if (syntax != BASESYNTAX && !parsebackquote && eofmark == NULL) 11745 if (syntax != BASESYNTAX && eofmark == NULL)
11761 raise_error_syntax("unterminated quoted string"); 11746 raise_error_syntax("unterminated quoted string");
11762 if (varnest != 0) { 11747 if (varnest != 0) {
11763 startlinno = g_parsefile->linno; 11748 startlinno = g_parsefile->linno;
@@ -12053,34 +12038,17 @@ parsesub: {
12053 */ 12038 */
12054parsebackq: { 12039parsebackq: {
12055 struct nodelist **nlpp; 12040 struct nodelist **nlpp;
12056 smallint savepbq;
12057 union node *n; 12041 union node *n;
12058 char *volatile str; 12042 char *str;
12059 struct jmploc jmploc;
12060 struct jmploc *volatile savehandler;
12061 size_t savelen; 12043 size_t savelen;
12062 smallint saveprompt = 0; 12044 smallint saveprompt = 0;
12063 12045
12064#ifdef __GNUC__
12065 (void) &saveprompt;
12066#endif
12067 savepbq = parsebackquote;
12068 if (setjmp(jmploc.loc)) {
12069 free(str);
12070 parsebackquote = 0;
12071 exception_handler = savehandler;
12072 longjmp(exception_handler->loc, 1);
12073 }
12074 INT_OFF;
12075 str = NULL; 12046 str = NULL;
12076 savelen = out - (char *)stackblock(); 12047 savelen = out - (char *)stackblock();
12077 if (savelen > 0) { 12048 if (savelen > 0) {
12078 str = ckmalloc(savelen); 12049 str = alloca(savelen);
12079 memcpy(str, stackblock(), savelen); 12050 memcpy(str, stackblock(), savelen);
12080 } 12051 }
12081 savehandler = exception_handler;
12082 exception_handler = &jmploc;
12083 INT_ON;
12084 if (oldstyle) { 12052 if (oldstyle) {
12085 /* We must read until the closing backquote, giving special 12053 /* We must read until the closing backquote, giving special
12086 * treatment to some slashes, and then push the string and 12054 * treatment to some slashes, and then push the string and
@@ -12151,7 +12119,6 @@ parsebackq: {
12151 nlpp = &(*nlpp)->next; 12119 nlpp = &(*nlpp)->next;
12152 *nlpp = stzalloc(sizeof(**nlpp)); 12120 *nlpp = stzalloc(sizeof(**nlpp));
12153 /* (*nlpp)->next = NULL; - stzalloc did it */ 12121 /* (*nlpp)->next = NULL; - stzalloc did it */
12154 parsebackquote = oldstyle;
12155 12122
12156 if (oldstyle) { 12123 if (oldstyle) {
12157 saveprompt = doprompt; 12124 saveprompt = doprompt;
@@ -12180,13 +12147,7 @@ parsebackq: {
12180 if (str) { 12147 if (str) {
12181 memcpy(out, str, savelen); 12148 memcpy(out, str, savelen);
12182 STADJUST(savelen, out); 12149 STADJUST(savelen, out);
12183 INT_OFF;
12184 free(str);
12185 str = NULL;
12186 INT_ON;
12187 } 12150 }
12188 parsebackquote = savepbq;
12189 exception_handler = savehandler;
12190 USTPUTC(CTLBACKQ, out); 12151 USTPUTC(CTLBACKQ, out);
12191 if (oldstyle) 12152 if (oldstyle)
12192 goto parsebackq_oldreturn; 12153 goto parsebackq_oldreturn;
@@ -12206,7 +12167,6 @@ parsearith: {
12206 goto parsearith_return; 12167 goto parsearith_return;
12207} 12168}
12208#endif 12169#endif
12209
12210} /* end of readtoken */ 12170} /* end of readtoken */
12211 12171
12212/* 12172/*