now fix that segfault and other bug from yesternight
do it like ksh93 though, not like bash and zsh
This commit is contained in:
parent
75db4cdb56
commit
a3c79ad771
14
check.t
14
check.t
@ -1,4 +1,4 @@
|
|||||||
# $MirOS: src/bin/mksh/check.t,v 1.421 2011/03/12 23:04:44 tg Exp $
|
# $MirOS: src/bin/mksh/check.t,v 1.422 2011/03/12 23:06:41 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 $
|
||||||
@ -1373,28 +1373,24 @@ expected-stdout:
|
|||||||
name: expand-threecolons-dblq
|
name: expand-threecolons-dblq
|
||||||
description:
|
description:
|
||||||
Check for a particular thing that used to segfault
|
Check for a particular thing that used to segfault
|
||||||
XXX still does, and decide on stderr
|
|
||||||
stdin:
|
stdin:
|
||||||
TEST=1234
|
TEST=1234
|
||||||
echo "${TEST:1:2:3}"
|
echo "${TEST:1:2:3}"
|
||||||
echo $? but still living
|
echo $? but still living
|
||||||
expected-stdout:
|
|
||||||
1 but still living
|
|
||||||
expected-stderr-pattern:
|
expected-stderr-pattern:
|
||||||
/.*/
|
/bad substitution/
|
||||||
|
expected-exit: 1
|
||||||
---
|
---
|
||||||
name: expand-threecolons-unq
|
name: expand-threecolons-unq
|
||||||
description:
|
description:
|
||||||
Check for a particular thing that used to not error out
|
Check for a particular thing that used to not error out
|
||||||
XXX still doesn't, and decide on stderr
|
|
||||||
stdin:
|
stdin:
|
||||||
TEST=1234
|
TEST=1234
|
||||||
echo ${TEST:1:2:3}
|
echo ${TEST:1:2:3}
|
||||||
echo $? but still living
|
echo $? but still living
|
||||||
expected-stdout:
|
|
||||||
1 but still living
|
|
||||||
expected-stderr-pattern:
|
expected-stderr-pattern:
|
||||||
/.*/
|
/bad substitution/
|
||||||
|
expected-exit: 1
|
||||||
---
|
---
|
||||||
name: eglob-bad-1
|
name: eglob-bad-1
|
||||||
description:
|
description:
|
||||||
|
6
eval.c
6
eval.c
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.97 2011/03/12 23:04:45 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.98 2011/03/12 23:06:43 tg Exp $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* string expansion
|
* string expansion
|
||||||
@ -391,7 +391,9 @@ expand(const char *cp, /* input word */
|
|||||||
} else {
|
} else {
|
||||||
end = mid +
|
end = mid +
|
||||||
(wdscan(mid, ADELIM) - mid);
|
(wdscan(mid, ADELIM) - mid);
|
||||||
if (end >= stg)
|
if (end >= stg ||
|
||||||
|
/* more than max delimiters */
|
||||||
|
end[-1] != /*{*/ '}')
|
||||||
goto unwind_substsyn;
|
goto unwind_substsyn;
|
||||||
end[-2] = EOS;
|
end[-2] = EOS;
|
||||||
sp += end - beg - 1;
|
sp += end - beg - 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user