[hackers] [sbase] Escape correctly characters in getrhs() || Roberto E. Vargas Caballero
commit 3e130cee6698c3c3f95468a7b8a4e782ea474338
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Wed Dec 16 19:44:44 2015 +0100
Commit: sin <sin_AT_2f30.org>
CommitDate: Wed Dec 16 20:16:12 2015 +0000
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.
diff --git a/ed.c b/ed.c
index 9a80eb9..33b4837 100644
--- a/ed.c
+++ b/ed.c
_AT_@ -890,6 +890,10 @@ getrhs(int delim)
s = NULL;
siz = cap = 0;
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('\0', s, &siz, &cap);
Received on Wed Dec 16 2015 - 21:16:19 CET
This archive was generated by hypermail 2.3.0
: Wed Dec 16 2015 - 21:24:15 CET