Skip to content

Commit

Permalink
server-info: skip empty lines.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Dec 21, 2005
1 parent 50e7b06 commit 8ac4838
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server-info.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ static int read_pack_info_file(const char *infofile)
while (fgets(line, sizeof(line), fp)) {
int len = strlen(line);
if (line[len-1] == '\n')
line[len-1] = 0;
line[--len] = 0;

if (!len)
continue;

switch (line[0]) {
case 'P': /* P name */
Expand Down

0 comments on commit 8ac4838

Please sign in to comment.