@matheusbsbs / matheus-bagliano / commits / 8ac4838af4
Fork 0

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>

Junio C Hamano committed Dec 21, 2005 at 13:48 UTC 8ac4838af428a2a32498b3e8d13295eb714654b4
1 file changed +4 -1
server-info.c
+4 -1
@@ -99,7 +99,10 @@ static int read_pack_info_file(const char *infofile)
99 while (fgets(line, sizeof(line), fp)) {
100 int len = strlen(line);
101 if (line[len-1] == '\n')
102 - line[len-1] = 0;
102 + line[--len] = 0;
103 +
104 + if (!len)
105 + continue;
106
107 switch (line[0]) {
108 case 'P': /* P name */