Skip to content

Commit

Permalink
ls-files: Don't require exclude files to end with a newline.
Browse files Browse the repository at this point in the history
Without this patch, the last line of an exclude file is silently
ignored if it doesn't end with a newline.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Alexandre Julliard authored and Junio C Hamano committed Mar 18, 2006
1 parent f5ef535 commit 451d7b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ls-files.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,12 @@ static int add_excludes_from_file_1(const char *fname,
close(fd);
return 0;
}
buf = xmalloc(size);
buf = xmalloc(size+1);
if (read(fd, buf, size) != size)
goto err;
close(fd);

buf[size++] = '\n';
entry = buf;
for (i = 0; i < size; i++) {
if (buf[i] == '\n') {
Expand Down

0 comments on commit 451d7b4

Please sign in to comment.