zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: zstat output of Unicode filenames
Date: Fri, 29 Apr 2022 22:33:52 -0700	[thread overview]
Message-ID: <CAH+w=7bGRvhgmvPqQ1xqJwbpk_tEkY1vedhez6ivTZX0+rR4vQ@mail.gmail.com> (raw)
In-Reply-To: <ecc75fc6-0fa2-4e28-8366-2daa94b32af1@www.fastmail.com>

[-- 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");
 	}

  reply	other threads:[~2022-04-30  5:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-30  0:41 Daniel Shahaf
2022-04-30  4:22 ` Bart Schaefer
2022-04-30  4:53   ` Daniel Shahaf
2022-04-30  5:33     ` Bart Schaefer [this message]
2022-05-01 14:46       ` Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7bGRvhgmvPqQ1xqJwbpk_tEkY1vedhez6ivTZX0+rR4vQ@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    --subject='Re: zstat output of Unicode filenames' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this 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).