sh: Fix LINENO and prompt after $'\0 and newline.
This commit is contained in:
parent
8b58e6af3c
commit
068dfa2d43
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=272482
@ -1279,6 +1279,13 @@ readcstyleesc(char *out)
|
||||
c = pgetc();
|
||||
if (c == PEOF)
|
||||
synerror("Unterminated quoted string");
|
||||
if (c == '\n') {
|
||||
plinno++;
|
||||
if (doprompt)
|
||||
setprompt(2);
|
||||
else
|
||||
setprompt(0);
|
||||
}
|
||||
}
|
||||
pungetc();
|
||||
return out;
|
||||
|
@ -100,6 +100,7 @@ FILES+= jobid2.0
|
||||
FILES+= kill1.0 kill2.0
|
||||
FILES+= lineno.0 lineno.0.stdout
|
||||
FILES+= lineno2.0
|
||||
FILES+= lineno3.0 lineno3.0.stdout
|
||||
FILES+= local1.0
|
||||
FILES+= local2.0
|
||||
FILES+= local3.0
|
||||
|
6
bin/sh/tests/builtins/lineno3.0
Normal file
6
bin/sh/tests/builtins/lineno3.0
Normal file
@ -0,0 +1,6 @@
|
||||
# $FreeBSD$
|
||||
|
||||
echo before: $LINENO
|
||||
dummy=$'a\0
|
||||
'
|
||||
echo after: $LINENO
|
2
bin/sh/tests/builtins/lineno3.0.stdout
Normal file
2
bin/sh/tests/builtins/lineno3.0.stdout
Normal file
@ -0,0 +1,2 @@
|
||||
before: 3
|
||||
after: 6
|
Loading…
Reference in New Issue
Block a user