Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zstat output of Unicode filenames
- X-seq: zsh-workers 50150
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: zstat output of Unicode filenames
- Date: Fri, 29 Apr 2022 22:33:52 -0700
- Archived-at: <https://zsh.org/workers/50150>
- In-reply-to: <ecc75fc6-0fa2-4e28-8366-2daa94b32af1@www.fastmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <20220430004132.GA7718@tarpaulin.shahaf.local2> <CAH+w=7bjVaMULf7_jXjtZRmBO9zAvLCkmy=3bp8DWOEUE+jVgA@mail.gmail.com> <ecc75fc6-0fa2-4e28-8366-2daa94b32af1@www.fastmail.com>
On Fri, Apr 29, 2022 at 9:54 PM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
>
> Thanks. Now it works by itself but not when preceded by é:
Typo, sorry.
diff --git a/Src/Modules/stat.c b/Src/Modules/stat.c
index 7c736072b..0df9b35b7 100644
--- a/Src/Modules/stat.c
+++ b/Src/Modules/stat.c
@@ -503,8 +503,10 @@ bin_stat(char *name, char **args, Options ops, UNUSED(int func))
if (OPT_ISSET(ops,'f'))
nargs = 1;
else
- for (aptr = args; *aptr; aptr++)
+ for (aptr = args; *aptr; aptr++) {
+ unmetafy(*aptr, NULL);
nargs++;
+ }
if (OPT_ISSET(ops,'g')) {
flags |= STF_GMT;
@@ -555,8 +557,8 @@ bin_stat(char *name, char **args, Options ops, UNUSED(int func))
for (; OPT_ISSET(ops,'f') || *args; args++) {
char outbuf[PATH_MAX + 9]; /* "link " + link name + NULL */
int rval = OPT_ISSET(ops,'f') ? fstat(fd, &statbuf) :
- OPT_ISSET(ops,'L') ? lstat(unmeta(*args), &statbuf) :
- stat(unmeta(*args), &statbuf);
+ OPT_ISSET(ops,'L') ? lstat(*args, &statbuf) :
+ stat(*args, &statbuf);
if (rval) {
if (OPT_ISSET(ops,'f'))
sprintf(outbuf, "%d", fd);
@@ -571,10 +573,10 @@ bin_stat(char *name, char **args, Options ops, UNUSED(int func))
if (flags & STF_FILE) {
if (arrnam)
- *arrptr++ = ztrdup(*args);
+ *arrptr++ = ztrdup_metafy(*args);
else if (hashnam) {
*hashptr++ = ztrdup(HNAMEKEY);
- *hashptr++ = ztrdup(*args);
+ *hashptr++ = ztrdup_metafy(*args);
} else
printf("%s%s", *args, (flags & STF_PICK) ? " " : ":\n");
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author