From e5bc23efcc90700710f97379d3116febc5705e19 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Thu, 1 Jul 2021 09:38:35 +0300 Subject: Fix the use of options with trailing slash in files-from list * src/names.c (read_name_from_file): Do not remove trailing slash here, since name_buffer might contain an option (e.g. -C /). (read_next_name): Remove trailing slash when we're sure we're dealing with a file name. See 163e96a0. --- src/names.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/names.c b/src/names.c index 503facb4..7773163c 100644 --- a/src/names.c +++ b/src/names.c @@ -980,7 +980,6 @@ read_name_from_file (struct name_elt *ent) if (counter == name_buffer_length) name_buffer = x2realloc (name_buffer, &name_buffer_length); name_buffer[counter] = 0; - chopslash (name_buffer); return (counter == 0 && c == EOF) ? file_list_end : file_list_success; } @@ -1060,6 +1059,7 @@ read_next_name (struct name_elt *ent, struct name_elt *ret) return 1; } } + chopslash (name_buffer); ret->type = NELT_NAME; ret->v.name = name_buffer; return 0; -- cgit v1.2.1