← Commit list

c8047030d

Denys Vlasenko
Denys Vlasenko
2026-08-31
SUCCESS Duration: 150s

Subject

vi: explain what vim 9.2 is doing with ":e FILE" escaping

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

editors/vi.c+7 -1
@@ -2685,12 +2685,18 @@ static void setops(char *args, int flg_no)
static char *expand_args(char *args)
{
char *s;
- const char *replace;
args = xstrdup(args);
for (s = args; *s; s++) {
+ const char *replace;
unsigned n;
+//NB: vim 9.2 replaces "\%" with "%" _over entire string_,
+//then replaces "\c" with "c". Result:
+// "\%" is "%" (ok),
+// "\\" is "\" (ok),
+// "\\%" is "\%" (!!!), not "\CURFILE" as you would think.
+//We don't do that. Should we?
if (*s == '%') {
replace = current_filename;
} else if (*s == '#') {