Explorar o código

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.
Sergey Poznyakoff %!s(int64=3) %!d(string=hai) anos
pai
achega
e5bc23efcc
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/names.c

+ 1 - 1
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;