summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5203083)
raw | patch | inline | side by side (parent: 5203083)
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | |
Thu, 20 Aug 2009 13:47:00 +0000 (20:47 +0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 24 Aug 2009 00:13:32 +0000 (17:13 -0700) |
In the next patch, the buffer that is being used within
add_excludes_from_file_1() comes from another function and does not
have extra space to put \n at the end.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
add_excludes_from_file_1() comes from another function and does not
have extra space to put \n at the end.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
dir.c | patch | blob | history |
index e05b850acf69867f2b931e7ca2f7430a9e7fc22d..1170d6467547ad3d72533d7fa640fd8021cbd9e0 100644 (file)
--- a/dir.c
+++ b/dir.c
if (buf_p)
*buf_p = buf;
- buf[size++] = '\n';
entry = buf;
- for (i = 0; i < size; i++) {
- if (buf[i] == '\n') {
+ for (i = 0; i <= size; i++) {
+ if (i == size || buf[i] == '\n') {
if (entry != buf + i && entry[0] != '#') {
buf[i - (i && buf[i-1] == '\r')] = 0;
add_exclude(entry, base, baselen, which);