--- ed.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/ed.c b/ed.c index 30709f4..2851729 100644 --- a/ed.c +++ b/ed.c _AT_@ -769,21 +769,15 @@ execsh(void) } while ((c = input()) != EOF && c != '\n') { - if (c == '\\') { - cmd = addchar(*p, cmd, &cap, &siz); - if ((c = input()) == EOF) - break; - cmd = addchar(input(), cmd, &cap, &siz); - } - if (c == '%') { + if (c == '%' && (siz == 0 || cmd[siz - 1] != '\\')) { if (savfname[0] == '\0') error("no current filename"); repl = 1; for (p = savfname; *p; ++p) cmd = addchar(*p, cmd, &cap, &siz); - continue; + } else { + cmd = addchar(c, cmd, &cap, &siz); } - cmd = addchar(c, cmd, &cap, &siz); } cmd = addchar('\0', cmd, &cap, &siz); -- 2.6.4Received on Sun Dec 13 2015 - 19:24:54 CET
This archive was generated by hypermail 2.3.0 : Sun Dec 13 2015 - 19:36:13 CET