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("$", "CVAR");
|
||||
add("}", "CENDVAR");
|
||||
/* ':/' for tilde expansion, '-' for [a\-x] pattern ranges */
|
||||
add("!*?[=~:/-", "CCTL");
|
||||
/* ':/' for tilde expansion, '-^]' for [a\-x] pattern ranges */
|
||||
add("!*?[]=~:/-^", "CCTL");
|
||||
print("dqsyntax");
|
||||
init();
|
||||
fputs("\n/* syntax table used when in single quotes */\n", cfile);
|
||||
add("\n", "CNL");
|
||||
add("\\", "CSBACK");
|
||||
add("'", "CENDQUOTE");
|
||||
/* ':/' for tilde expansion, '-' for [a\-x] pattern ranges */
|
||||
add("!*?[=~:/-", "CCTL");
|
||||
/* ':/' for tilde expansion, '-^]' for [a\-x] pattern ranges */
|
||||
add("!*?[]=~:/-^", "CCTL");
|
||||
print("sqsyntax");
|
||||
init();
|
||||
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