@@ -2,27 +2,41 @@ Index: gnu/tests/env/env-S.pl
22===================================================================
33--- gnu.orig/tests/env/env-S.pl
44+++ gnu/tests/env/env-S.pl
5- @@ -212,27 +212,28 @@ my @Tests =
6- {ERR=>"$prog: no terminating quote in -S string\n"}],
5+ @@ -200,36 +200,37 @@ my @Tests =
6+
7+ # Test Error Conditions
8+ ['err1', q[-S'"\\c"'], {EXIT=>125},
9+ - {ERR=>"$prog: '\\c' must not appear in double-quoted -S string\n"}],
10+ + {ERR=>"$prog: '\\c' must not appear in double-quoted -S string at position 2\n"}],
11+ ['err2', q[-S'A=B\\'], {EXIT=>125},
12+ - {ERR=>"$prog: invalid backslash at end of string in -S\n"}],
13+ + {ERR=>"$prog: invalid backslash at end of string in -S at position 4 in context Unquoted\n"}],
14+ ['err3', q[-S'"A=B\\"'], {EXIT=>125},
15+ - {ERR=>"$prog: no terminating quote in -S string\n"}],
16+ + {ERR=>"$prog: no terminating quote in -S string at position 6 for quote '\"'\n"}],
17+ ['err4', q[-S"'A=B\\\\'"], {EXIT=>125},
18+ - {ERR=>"$prog: no terminating quote in -S string\n"}],
19+ + {ERR=>"$prog: no terminating quote in -S string at position 6 for quote '''\n"}],
720 ['err5', q[-S'A=B\\q'], {EXIT=>125},
8- {ERR=>"$prog: invalid sequence '\\q' in -S\n"}],
21+ - {ERR=>"$prog: invalid sequence '\\q' in -S\n"}],
922- ['err6', q[-S'A=$B'], {EXIT=>125},
1023- {ERR=>"$prog: only \${VARNAME} expansion is supported, error at: \$B\n"}],
24+ + {ERR=>"$prog: invalid sequence '\\q' in -S at position 4\n"}],
1125+ ['err6', q[-S'A=$B echo hello'], {EXIT=>0},
1226+ {OUT=>"hello"}],
1327 ['err7', q[-S'A=${B'], {EXIT=>125},
1428- {ERR=>"$prog: only \${VARNAME} expansion is supported, " .
1529- "error at: \${B\n"}],
16- + {ERR=>"$prog" . qq[: variable name issue (at 5): Missing closing brace\n]}],
30+ + {ERR=>"$prog" . qq[: variable name issue (at 5): Missing closing brace at position 5 \n]}],
1731 ['err8', q[-S'A=${B%B}'], {EXIT=>125},
1832- {ERR=>"$prog: only \${VARNAME} expansion is supported, " .
1933- "error at: \${B%B}\n"}],
20- + {ERR=>"$prog" . qq[: variable name issue (at 5): Unexpected character: '%', expected a closing brace ('}') or colon (':')\n]}],
34+ + {ERR=>"$prog" . qq[: variable name issue (at 5): Unexpected character: '%', expected a closing brace ('}') or colon (':') at position 5 \n]}],
2135 ['err9', q[-S'A=${9B}'], {EXIT=>125},
2236- {ERR=>"$prog: only \${VARNAME} expansion is supported, " .
2337- "error at: \${9B}\n"}],
24- + {ERR=>"$prog" . qq[: variable name issue (at 4): Unexpected character: '9', expected variable name must not start with 0..9\n]}],
25-
38+ + {ERR=>"$prog" . qq[: variable name issue (at 4): Unexpected character: '9', expected variable name must not start with 0..9 at position 4 \n]}],
39+
2640 # Test incorrect shebang usage (extraneous whitespace).
2741 ['err_sp2', q['-v -S cat -n'], {EXIT=>125},
2842- {ERR=>"env: invalid option -- ' '\n" .
@@ -42,6 +56,6 @@ Index: gnu/tests/env/env-S.pl
4256+ "Usage: $prog [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]\n\n" .
4357+ "For more information, try '--help'.\n" .
4458+ "$prog: use -[v]S to pass options in shebang lines\n"}],
45-
59+
4660 # Also diagnose incorrect shebang usage when failing to exec.
4761 # This typically happens with:
0 commit comments