--one-top-level now keeps "../" and ".../"

* src/list.c (enforce_one_top_level): Do not strip prefixes like
"../" (which should not be allowed unless -P) and ".../" (which
are ordinary file names).  The "../" not being allowed should be
addressed in a different way.
This commit is contained in:
Paul Eggert
2026-04-07 11:11:21 -07:00
parent b4fc9ca136
commit 90dec1cc53

View File

@@ -120,8 +120,16 @@ enforce_one_top_level (char **pfile_name)
char *file_name = *pfile_name;
char *p;
for (p = file_name; *p && (ISSLASH (*p) || *p == '.'); p++)
;
for (p = file_name; ; p++)
{
bool dot = p[0] == '.';
if (!ISSLASH (p[dot]))
{
p += dot & !p[dot];
break;
}
p += dot;
}
if (*p)
{