Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zcompile doesn't support Unicode file names
- X-seq: zsh-workers 46239
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- Subject: Re: zcompile doesn't support Unicode file names
- Date: Sun, 12 Jul 2020 17:51:06 +0000
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- In-reply-to: <CAKc7PVALXfBJcnsWk3-brU=y7nt0WnYh_LmQacN+WMo5xGRonA@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVALXfBJcnsWk3-brU=y7nt0WnYh_LmQacN+WMo5xGRonA@mail.gmail.com>
- Sender: zsh-workers@xxxxxxx
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