mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-30 19:20:53 +02:00
50150: Filenames need unmetafy for printing
This commit is contained in:
parent
079bb60289
commit
276020522e
2 changed files with 9 additions and 5 deletions
|
@ -1,5 +1,7 @@
|
||||||
2022-04-30 Bart Schaefer <schaefer@zsh.org>
|
2022-04-30 Bart Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
|
* 50150: Src/Modules/stat.c: Filenames need unmetafy for printing
|
||||||
|
|
||||||
* 50149: Etc/BUGS, Src/builtin.c, Src/jobs.c: Remove all =(...)
|
* 50149: Etc/BUGS, Src/builtin.c, Src/jobs.c: Remove all =(...)
|
||||||
files at shell exit
|
files at shell exit
|
||||||
|
|
||||||
|
|
|
@ -503,8 +503,10 @@ bin_stat(char *name, char **args, Options ops, UNUSED(int func))
|
||||||
if (OPT_ISSET(ops,'f'))
|
if (OPT_ISSET(ops,'f'))
|
||||||
nargs = 1;
|
nargs = 1;
|
||||||
else
|
else
|
||||||
for (aptr = args; *aptr; aptr++)
|
for (aptr = args; *aptr; aptr++) {
|
||||||
|
unmetafy(*aptr, NULL);
|
||||||
nargs++;
|
nargs++;
|
||||||
|
}
|
||||||
|
|
||||||
if (OPT_ISSET(ops,'g')) {
|
if (OPT_ISSET(ops,'g')) {
|
||||||
flags |= STF_GMT;
|
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++) {
|
for (; OPT_ISSET(ops,'f') || *args; args++) {
|
||||||
char outbuf[PATH_MAX + 9]; /* "link " + link name + NULL */
|
char outbuf[PATH_MAX + 9]; /* "link " + link name + NULL */
|
||||||
int rval = OPT_ISSET(ops,'f') ? fstat(fd, &statbuf) :
|
int rval = OPT_ISSET(ops,'f') ? fstat(fd, &statbuf) :
|
||||||
OPT_ISSET(ops,'L') ? lstat(unmeta(*args), &statbuf) :
|
OPT_ISSET(ops,'L') ? lstat(*args, &statbuf) :
|
||||||
stat(unmeta(*args), &statbuf);
|
stat(*args, &statbuf);
|
||||||
if (rval) {
|
if (rval) {
|
||||||
if (OPT_ISSET(ops,'f'))
|
if (OPT_ISSET(ops,'f'))
|
||||||
sprintf(outbuf, "%d", fd);
|
sprintf(outbuf, "%d", fd);
|
||||||
|
@ -571,10 +573,10 @@ bin_stat(char *name, char **args, Options ops, UNUSED(int func))
|
||||||
|
|
||||||
if (flags & STF_FILE) {
|
if (flags & STF_FILE) {
|
||||||
if (arrnam)
|
if (arrnam)
|
||||||
*arrptr++ = ztrdup(*args);
|
*arrptr++ = ztrdup_metafy(*args);
|
||||||
else if (hashnam) {
|
else if (hashnam) {
|
||||||
*hashptr++ = ztrdup(HNAMEKEY);
|
*hashptr++ = ztrdup(HNAMEKEY);
|
||||||
*hashptr++ = ztrdup(*args);
|
*hashptr++ = ztrdup_metafy(*args);
|
||||||
} else
|
} else
|
||||||
printf("%s%s", *args, (flags & STF_PICK) ? " " : ":\n");
|
printf("%s%s", *args, (flags & STF_PICK) ? " " : ":\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue