fix for parameter length expressions for nameref variables expanding to invalid identifiers

This commit is contained in:
Chet Ramey
2022-12-13 12:57:47 -05:00
parent 237c32ba16
commit 49918d90cd
12 changed files with 7024 additions and 5353 deletions
+7 -3
View File
@@ -318,6 +318,7 @@ int flags;
struct group *gr;
int p;
char *b;
intmax_t xtime;
st = getstat(f);
if (st == NULL)
@@ -325,20 +326,23 @@ int flags;
/* Print requested info */
if (flags & OPT_ATIME) {
xtime = st->st_atime;
if (flags & OPT_ASCII)
printf("%s", ctime(&st->st_atime));
else
printf("%ld\n", st->st_atime);
printf("%jd\n", xtime);
} else if (flags & OPT_MTIME) {
xtime = st->st_mtime;
if (flags & OPT_ASCII)
printf("%s", ctime(&st->st_mtime));
else
printf("%ld\n", st->st_mtime);
printf("%jd\n", xtime);
} else if (flags & OPT_CTIME) {
xtime = st->st_ctime;
if (flags & OPT_ASCII)
printf("%s", ctime(&st->st_ctime));
else
printf("%ld\n", st->st_ctime);
printf("%jd\n", xtime);
} else if (flags & OPT_DEV)
printf("%lu\n", (unsigned long)st->st_dev);
else if (flags & OPT_INO)