Escape correctly characters in getrhs()
getrhs() must remove \ excepts in the case of & and \d (where d is a digit), because in this case are sequences understood by addsub(), so addsub() must be able to see them.
This commit is contained in:
parent
a65e180e5e
commit
3e130cee66
4
ed.c
4
ed.c
@ -890,6 +890,10 @@ getrhs(int delim)
|
|||||||
s = NULL;
|
s = NULL;
|
||||||
siz = cap = 0;
|
siz = cap = 0;
|
||||||
while ((c = input()) != '\n' && c != EOF && c != delim) {
|
while ((c = input()) != '\n' && c != EOF && c != delim) {
|
||||||
|
if (c == '\\') {
|
||||||
|
if ((c = input()) == '&' || isdigit(c))
|
||||||
|
s = addchar(c, s, &siz, &cap);
|
||||||
|
}
|
||||||
s = addchar(c, s, &siz, &cap);
|
s = addchar(c, s, &siz, &cap);
|
||||||
}
|
}
|
||||||
s = addchar('\0', s, &siz, &cap);
|
s = addchar('\0', s, &siz, &cap);
|
||||||
|
Loading…
Reference in New Issue
Block a user