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

Re: zcompile doesn't support Unicode file names



Sebastian Gniazdowski wrote on Sun, 12 Jul 2020 19:28 +0200:
> % touch ↑abc
> % zcompile ↑abc
> zcompile: can't open file: ↑abc

Looks like some unmeta() calls are missing.  One of them is below —
wasn't hard to find; I just opened bin_zcompile() and searched for the
error message — but with that patch I get 'b\xc3\x83\x81r.zwc' rather
than 'bár.zwc', so I guess a few more calls are needed.  I won't be
tracking them down.

(Not going to commit this patch, either.  It's incomplete and lacks a
test case.)

diff --git a/Src/parse.c b/Src/parse.c
index 10c9b4c29..9deda2aea 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -3399,7 +3399,7 @@ build_dump(char *nam, char *dump, char **files, int ali, int map, int flags)
 	    flags = (flags & ~(FDHF_KSHLOAD | FDHF_ZSHLOAD)) | FDHF_ZSHLOAD;
 	    continue;
 	}
-	if ((fd = open(*files, O_RDONLY)) < 0 ||
+	if ((fd = open(unmeta(*files), O_RDONLY)) < 0 ||
 	    fstat(fd, &st) != 0 || !S_ISREG(st.st_mode) ||
 	    (flen = lseek(fd, 0, 2)) == -1) {
 	    if (fd >= 0)



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