Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: Fix double unmeta in rm verification



nicezputs already unmetas the string, resulting in corruption of the output,
% rm foo/*
zsh: sure you want to delete all the files in /.../オ\M-c\M-\nジ\M-c^D\M-c\M-^Kサウ\M-c\M-^S\M-c\t\M-c^H\M-c\M-\t\M-c\M-#ク/foo [yn]? n
Weirdly, it doesn't happen in these cases,
% rm *
zsh: sure you want to delete all the files in /.../オリジナルサウンドトラック [yn]? n
% rm オリジナルサウンドトラック/*
zsh: sure you want to delete all the files in /.../オリジナルサウンドトラック [yn]? n

And this suggests that the meta state is not entirely consistent,
% mkcd オリジナルサウンドトラック
% rm オリジナルサウンドトラック/*
zsh: sure you want to delete all the files in /.../オ\M-c\M-\nジ\M-c^D\M-c\M-^Kサウ\M-c\M-^S\M-c\t\M-c^H\M-c\M-\t\M-c\M-#ク/オリジナルサウンドトラック [yn]? n

It might be less weird if I read the surrounding code, which I haven't,
but this change seems obviously correct anyway. All four above cases
now work.

---
 Src/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Src/utils.c b/Src/utils.c
index 47d9944..702829c 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -2460,7 +2460,7 @@ checkrmall(char *s)
 	return 1;
     fprintf(shout, "zsh: sure you want to delete all the files in ");
     if (*s != '/') {
-	nicezputs(pwd[1] ? unmeta(pwd) : "", shout);
+	nicezputs(pwd[1] ? pwd : "", shout);
 	fputc('/', shout);
     }
     nicezputs(s, shout);
-- 
2.2.0.GIT



Messages sorted by: Reverse Date, Date, Thread, Author