sh: Allow quoting ^ and ] in bracket expressions.
This commit is contained in:
parent
6e8db49a44
commit
3a1b9c9e82
@ -219,16 +219,16 @@ main(int argc __unused, char **argv __unused)
|
|||||||
add("`", "CBQUOTE");
|
add("`", "CBQUOTE");
|
||||||
add("$", "CVAR");
|
add("$", "CVAR");
|
||||||
add("}", "CENDVAR");
|
add("}", "CENDVAR");
|
||||||
/* ':/' for tilde expansion, '-' for [a\-x] pattern ranges */
|
/* ':/' for tilde expansion, '-^]' for [a\-x] pattern ranges */
|
||||||
add("!*?[=~:/-", "CCTL");
|
add("!*?[]=~:/-^", "CCTL");
|
||||||
print("dqsyntax");
|
print("dqsyntax");
|
||||||
init();
|
init();
|
||||||
fputs("\n/* syntax table used when in single quotes */\n", cfile);
|
fputs("\n/* syntax table used when in single quotes */\n", cfile);
|
||||||
add("\n", "CNL");
|
add("\n", "CNL");
|
||||||
add("\\", "CSBACK");
|
add("\\", "CSBACK");
|
||||||
add("'", "CENDQUOTE");
|
add("'", "CENDQUOTE");
|
||||||
/* ':/' for tilde expansion, '-' for [a\-x] pattern ranges */
|
/* ':/' for tilde expansion, '-^]' for [a\-x] pattern ranges */
|
||||||
add("!*?[=~:/-", "CCTL");
|
add("!*?[]=~:/-^", "CCTL");
|
||||||
print("sqsyntax");
|
print("sqsyntax");
|
||||||
init();
|
init();
|
||||||
fputs("\n/* syntax table used when in arithmetic */\n", cfile);
|
fputs("\n/* syntax table used when in arithmetic */\n", cfile);
|
||||||
|
12
tools/regression/bin/sh/builtins/case13.0
Normal file
12
tools/regression/bin/sh/builtins/case13.0
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# $FreeBSD$
|
||||||
|
|
||||||
|
case ^ in
|
||||||
|
[\^^]) ;;
|
||||||
|
*) echo Failed at $LINENO ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case s in
|
||||||
|
[\^^]) echo Failed at $LINENO ;;
|
||||||
|
[s\]]) ;;
|
||||||
|
*) echo Failed at $LINENO ;;
|
||||||
|
esac
|
Loading…
x
Reference in New Issue
Block a user