let SLETARRAY use SRETRACE, too
This commit is contained in:
parent
f16386954d
commit
e66eaab861
17
check.t
17
check.t
@ -1,4 +1,4 @@
|
|||||||
# $MirOS: src/bin/mksh/check.t,v 1.423 2011/03/13 01:20:14 tg Exp $
|
# $MirOS: src/bin/mksh/check.t,v 1.424 2011/03/13 15:57:21 tg Exp $
|
||||||
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
|
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
|
||||||
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
|
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
|
||||||
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
|
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
|
||||||
@ -6947,6 +6947,8 @@ stdin:
|
|||||||
echo $(case 1 in 1) echo yes;; 2) echo no;; esac)
|
echo $(case 1 in 1) echo yes;; 2) echo no;; esac)
|
||||||
echo $(($(case 1 in (1) echo 1;; (*) echo 2;; esac)+10))
|
echo $(($(case 1 in (1) echo 1;; (*) echo 2;; esac)+10))
|
||||||
echo $(($(case 1 in 1) echo 1;; *) echo 2;; esac)+20))
|
echo $(($(case 1 in 1) echo 1;; *) echo 2;; esac)+20))
|
||||||
|
a=($(case 1 in (1) echo 1;; (*) echo 2;; esac)); echo ${a[0]}.
|
||||||
|
a=($(case 1 in 1) echo 1;; *) echo 2;; esac)); echo ${a[0]}.
|
||||||
TEST=1234; echo ${TEST: $(case 1 in (1) echo 1;; (*) echo 2;; esac)}
|
TEST=1234; echo ${TEST: $(case 1 in (1) echo 1;; (*) echo 2;; esac)}
|
||||||
TEST=5678; echo ${TEST: $(case 1 in 1) echo 1;; *) echo 2;; esac)}
|
TEST=5678; echo ${TEST: $(case 1 in 1) echo 1;; *) echo 2;; esac)}
|
||||||
(( a = $(case 1 in (1) echo 1;; (*) echo 2;; esac) )); echo $a.
|
(( a = $(case 1 in (1) echo 1;; (*) echo 2;; esac) )); echo $a.
|
||||||
@ -6956,22 +6958,13 @@ expected-stdout:
|
|||||||
yes
|
yes
|
||||||
11
|
11
|
||||||
21
|
21
|
||||||
|
1.
|
||||||
|
1.
|
||||||
234
|
234
|
||||||
678
|
678
|
||||||
1.
|
1.
|
||||||
1.
|
1.
|
||||||
---
|
---
|
||||||
name: comsub-1b
|
|
||||||
description:
|
|
||||||
COMSUB inside SLETARRAY and SASPAREN/EXPRSUB
|
|
||||||
expected-fail: yes
|
|
||||||
stdin:
|
|
||||||
a=($(case 1 in (1) echo 1;; (*) echo 2;; esac)); echo ${a[0]}.
|
|
||||||
a=($(case 1 in 1) echo 1;; *) echo 2;; esac)); echo ${a[0]}.
|
|
||||||
expected-stdout:
|
|
||||||
1.
|
|
||||||
1.
|
|
||||||
---
|
|
||||||
name: comsub-2
|
name: comsub-2
|
||||||
description:
|
description:
|
||||||
RedHat BZ#496791 – another case of missing recursion
|
RedHat BZ#496791 – another case of missing recursion
|
||||||
|
26
lex.c
26
lex.c
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.137 2011/03/13 15:31:46 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.138 2011/03/13 15:57:23 tg Exp $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* states while lexing word
|
* states while lexing word
|
||||||
@ -214,17 +214,18 @@ yylex(int cf)
|
|||||||
backslash_skip = 0;
|
backslash_skip = 0;
|
||||||
ignore_backslash_newline = 0;
|
ignore_backslash_newline = 0;
|
||||||
|
|
||||||
if (cf&ONEWORD)
|
if (cf & ONEWORD)
|
||||||
state = SWORD;
|
state = SWORD;
|
||||||
else if (cf&LETEXPR) {
|
else if (cf & LETEXPR) {
|
||||||
/* enclose arguments in (double) quotes */
|
/* enclose arguments in (double) quotes */
|
||||||
*wp++ = OQUOTE;
|
*wp++ = OQUOTE;
|
||||||
state = SLETPAREN;
|
state = SLETPAREN;
|
||||||
statep->nparen = 0;
|
statep->nparen = 0;
|
||||||
#ifndef MKSH_SMALL
|
#ifndef MKSH_SMALL
|
||||||
} else if (cf&LETARRAY) {
|
} else if (cf & LETARRAY) {
|
||||||
state = SLETARRAY;
|
state = SLETARRAY;
|
||||||
statep->nparen = 0;
|
statep->nparen = 0;
|
||||||
|
PUSH_SRETRACE();
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
/* normal lexing */
|
/* normal lexing */
|
||||||
@ -789,13 +790,20 @@ yylex(int cf)
|
|||||||
++statep->nparen;
|
++statep->nparen;
|
||||||
else if (c == /*(*/')') {
|
else if (c == /*(*/')') {
|
||||||
if (statep->nparen-- == 0) {
|
if (statep->nparen-- == 0) {
|
||||||
c = 0;
|
POP_SRETRACE();
|
||||||
|
/* drop trailing paren */
|
||||||
|
c = strlen(dp = sp) - 1;
|
||||||
|
XcheckN(ws, wp, c * 2);
|
||||||
|
while (c--) {
|
||||||
|
*wp++ = CHAR;
|
||||||
|
*wp++ = *dp++;
|
||||||
|
}
|
||||||
|
afree(sp, ATEMP);
|
||||||
|
/* assert: c == 0 */
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*wp++ = CHAR;
|
goto Sbase2;
|
||||||
*wp++ = c;
|
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* <<< delimiter */
|
/* <<< delimiter */
|
||||||
@ -1064,7 +1072,7 @@ yylex(int cf)
|
|||||||
/* word is not unquoted */
|
/* word is not unquoted */
|
||||||
*ident = '\0';
|
*ident = '\0';
|
||||||
|
|
||||||
if (*ident != '\0' && (cf&(KEYWORD|ALIAS))) {
|
if (*ident != '\0' && (cf & (KEYWORD | ALIAS))) {
|
||||||
struct tbl *p;
|
struct tbl *p;
|
||||||
uint32_t h = hash(ident);
|
uint32_t h = hash(ident);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user