* zstat output of Unicode filenames
@ 2022-04-30 0:41 Daniel Shahaf
2022-04-30 4:22 ` Bart Schaefer
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Shahaf @ 2022-04-30 0:41 UTC (permalink / raw)
To: zsh-workers
% print -n Ą | xxd -p
c484
% touch Ą
% zstat -nor -- * | head -1
ă�:
% zstat -nor -- * | head -1 | xxd -p | me
c483 a43a 0a
%
Looks like a missing unmetafy()?
Cheers,
Daniel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: zstat output of Unicode filenames
2022-04-30 0:41 zstat output of Unicode filenames Daniel Shahaf
@ 2022-04-30 4:22 ` Bart Schaefer
2022-04-30 4:53 ` Daniel Shahaf
0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2022-04-30 4:22 UTC (permalink / raw)
To: Daniel Shahaf; +Cc: Zsh hackers list
[-- Attachment #1: Type: text/plain, Size: 126 bytes --]
On Fri, Apr 29, 2022 at 5:42 PM Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
>
> Looks like a missing unmetafy()?
Try this?
[-- Attachment #2: zstatmeta.txt --]
[-- Type: text/plain, Size: 1366 bytes --]
diff --git a/Src/Modules/stat.c b/Src/Modules/stat.c
index 7c736072b..ce042fced 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(*args, 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");
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: zstat output of Unicode filenames
2022-04-30 4:22 ` Bart Schaefer
@ 2022-04-30 4:53 ` Daniel Shahaf
2022-04-30 5:33 ` Bart Schaefer
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Shahaf @ 2022-04-30 4:53 UTC (permalink / raw)
To: Bart Schaefer; +Cc: Zsh hackers list
Bart Schaefer wrote on Sat, 30 Apr 2022 04:22 +00:00:
> On Fri, Apr 29, 2022 at 5:42 PM Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
>>
>> Looks like a missing unmetafy()?
>
> Try this?
Thanks. Now it works by itself but not when preceded by é:
% zstat -nor -- Ą
Ą:
⋮
% zstat -nor -- é Ą
zstat: Ą: no such file or directory
é:
⋮
%
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: zstat output of Unicode filenames
2022-04-30 4:53 ` Daniel Shahaf
@ 2022-04-30 5:33 ` Bart Schaefer
2022-05-01 14:46 ` Daniel Shahaf
0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2022-04-30 5:33 UTC (permalink / raw)
To: Zsh hackers list
[-- Attachment #1: Type: text/plain, Size: 162 bytes --]
On Fri, Apr 29, 2022 at 9:54 PM Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
>
> Thanks. Now it works by itself but not when preceded by é:
Typo, sorry.
[-- Attachment #2: zstatmeta2.txt --]
[-- Type: text/plain, Size: 1366 bytes --]
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");
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: zstat output of Unicode filenames
2022-04-30 5:33 ` Bart Schaefer
@ 2022-05-01 14:46 ` Daniel Shahaf
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Shahaf @ 2022-05-01 14:46 UTC (permalink / raw)
To: zsh-workers
Bart Schaefer wrote on Sat, 30 Apr 2022 05:33 +00:00:
> On Fri, Apr 29, 2022 at 9:54 PM Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
>>
>> Thanks. Now it works by itself but not when preceded by é:
>
> Typo, sorry.
Confirmed in my original test case, and I see you've pushed this too. Thanks.
Daniel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-05-01 14:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-30 0:41 zstat output of Unicode filenames Daniel Shahaf
2022-04-30 4:22 ` Bart Schaefer
2022-04-30 4:53 ` Daniel Shahaf
2022-04-30 5:33 ` Bart Schaefer
2022-05-01 14:46 ` Daniel Shahaf
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).