ADELIM can be ‘}’ too, not just ‘/’, in code that checks for / vs. //
caught by new code after segfault report by bef0rd on IRC (thanks!)
This commit is contained in:
10
check.t
10
check.t
@ -1,4 +1,4 @@
|
|||||||
# $MirOS: src/bin/mksh/check.t,v 1.723 2016/02/11 20:19:44 tg Exp $
|
# $MirOS: src/bin/mksh/check.t,v 1.724 2016/02/24 01:47:30 tg Exp $
|
||||||
# -*- mode: sh -*-
|
# -*- mode: sh -*-
|
||||||
#-
|
#-
|
||||||
# Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
# Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||||
@ -30,7 +30,7 @@
|
|||||||
# (2013/12/02 20:39:44) http://openbsd.cs.toronto.edu/cgi-bin/cvsweb/src/regress/bin/ksh/?sortby=date
|
# (2013/12/02 20:39:44) http://openbsd.cs.toronto.edu/cgi-bin/cvsweb/src/regress/bin/ksh/?sortby=date
|
||||||
|
|
||||||
expected-stdout:
|
expected-stdout:
|
||||||
@(#)MIRBSD KSH R52 2016/01/21
|
@(#)MIRBSD KSH R52 2016/02/23
|
||||||
description:
|
description:
|
||||||
Check version of shell.
|
Check version of shell.
|
||||||
stdin:
|
stdin:
|
||||||
@ -39,7 +39,7 @@ name: KSH_VERSION
|
|||||||
category: shell:legacy-no
|
category: shell:legacy-no
|
||||||
---
|
---
|
||||||
expected-stdout:
|
expected-stdout:
|
||||||
@(#)LEGACY KSH R52 2016/01/21
|
@(#)LEGACY KSH R52 2016/02/23
|
||||||
description:
|
description:
|
||||||
Check version of legacy shell.
|
Check version of legacy shell.
|
||||||
stdin:
|
stdin:
|
||||||
@ -1858,7 +1858,7 @@ stdin:
|
|||||||
[[ -n $BASH_VERSION ]] && shopt -s extglob
|
[[ -n $BASH_VERSION ]] && shopt -s extglob
|
||||||
x=1222321_ab/cde_b/c_1221
|
x=1222321_ab/cde_b/c_1221
|
||||||
y=xyz
|
y=xyz
|
||||||
echo 1: ${x/2}
|
echo 1: ${x/2} . ${x/}
|
||||||
echo 2: ${x//2}
|
echo 2: ${x//2}
|
||||||
echo 3: ${x/+(2)}
|
echo 3: ${x/+(2)}
|
||||||
echo 4: ${x//+(2)}
|
echo 4: ${x//+(2)}
|
||||||
@ -1890,7 +1890,7 @@ stdin:
|
|||||||
echo 30: ${x//\\a/9}
|
echo 30: ${x//\\a/9}
|
||||||
echo 31: ${x/2/$y}
|
echo 31: ${x/2/$y}
|
||||||
expected-stdout:
|
expected-stdout:
|
||||||
1: 122321_ab/cde_b/c_1221
|
1: 122321_ab/cde_b/c_1221 . 1222321_ab/cde_b/c_1221
|
||||||
2: 131_ab/cde_b/c_11
|
2: 131_ab/cde_b/c_11
|
||||||
3: 1321_ab/cde_b/c_1221
|
3: 1321_ab/cde_b/c_1221
|
||||||
4: 131_ab/cde_b/c_11
|
4: 131_ab/cde_b/c_11
|
||||||
|
4
eval.c
4
eval.c
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.181 2016/01/21 18:24:38 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.182 2016/02/24 01:47:32 tg Exp $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* string expansion
|
* string expansion
|
||||||
@ -1151,7 +1151,7 @@ varsub(Expand *xp, const char *sp, const char *word,
|
|||||||
if (!stype && c == '/') {
|
if (!stype && c == '/') {
|
||||||
slen += 2;
|
slen += 2;
|
||||||
stype = c;
|
stype = c;
|
||||||
if (word[slen] == ADELIM) {
|
if (word[slen] == ADELIM && word[slen + 1] == c) {
|
||||||
slen += 2;
|
slen += 2;
|
||||||
stype |= 0x80;
|
stype |= 0x80;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user