Introduction
Introduction Statistics Contact Development Disclaimer Help
ed: Improve execsh - sbase - suckless unix tools
git clone git://git.suckless.org/sbase
Log
Files
Refs
README
LICENSE
---
commit 890f6c2c050149e63efe5b385b104c8383342973
parent aacfa18b79f459b8419f424079d50fc5bc263791
Author: Roberto E. Vargas Caballero <[email protected]>
Date: Mon, 27 Nov 2023 09:21:45 +0100
ed: Improve execsh
Diffstat:
M ed.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/ed.c b/ed.c
@@ -1067,13 +1067,21 @@ execsh(void)
}
while ((c = input()) != '\0') {
- if (c == '%' && (cmd.siz == 0 || cmd.str[cmd.siz - 1] != '\\')…
+ switch (c) {
+ case '%':
if (savfname[0] == '\0')
error("no current filename");
repl = 1;
for (p = savfname; *p; ++p)
addchar(*p, &cmd);
- } else {
+ break;
+ case '\\':
+ c = input();
+ if (c != '%') {
+ back(c);
+ c = '\\';
+ }
+ default:
addchar(c, &cmd);
}
}
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.