fix \r followed by something else than \n or EOF
This commit is contained in:
parent
62a5331aee
commit
859746b30b
12
eval.c
12
eval.c
|
@ -888,10 +888,16 @@ expand(
|
||||||
{
|
{
|
||||||
if (c == '\r') {
|
if (c == '\r') {
|
||||||
c = shf_getc(x.u.shf);
|
c = shf_getc(x.u.shf);
|
||||||
if (c == -1)
|
switch (c) {
|
||||||
c = '\r';
|
case '\n':
|
||||||
else if (c != '\n')
|
break;
|
||||||
|
default:
|
||||||
shf_ungetc(c, x.u.shf);
|
shf_ungetc(c, x.u.shf);
|
||||||
|
/* FALLTHROUGH */
|
||||||
|
case -1:
|
||||||
|
c = '\r';
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (c == '\n')
|
if (c == '\n')
|
||||||
|
|
Loading…
Reference in New Issue