Skip to content

Commit 8ac4838

Browse files
author
Junio C Hamano
committed
server-info: skip empty lines.
Now we allow an empty line in objects/info/packs file, recognize that and stop complaining. Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 50e7b06 commit 8ac4838

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server-info.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ static int read_pack_info_file(const char *infofile)
9999
while (fgets(line, sizeof(line), fp)) {
100100
int len = strlen(line);
101101
if (line[len-1] == '\n')
102-
line[len-1] = 0;
102+
line[--len] = 0;
103+
104+
if (!len)
105+
continue;
103106

104107
switch (line[0]) {
105108
case 'P': /* P name */

0 commit comments

Comments
 (0)