Skip to content

Commit

Permalink
Fixed bug introduced in previous edit which caused a blank option to …
Browse files Browse the repository at this point in the history
…be read at end of option file.

git-svn-id: https://ctags.svn.sourceforge.net/svnroot/ctags/trunk@415 c5d04d22-be80-434c-894e-aa346cc9e8e8
  • Loading branch information
Darren Hiebert committed Aug 15, 2004
1 parent 9c95856 commit 046e67b
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions args.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,19 @@ static char* nextFileLine (FILE* const fp)
break;
c = fgetc (fp);
}
if (c == '\r')
if (c != EOF || vStringLength (vs) > 0)
{
c = fgetc (fp);
if (c != '\n')
c = ungetc (c, fp);
if (c == '\r')
{
c = fgetc (fp);
if (c != '\n')
c = ungetc (c, fp);
}
vStringTerminate (vs);
result = xMalloc (vStringLength (vs) + 1, char);
strcpy (result, vStringValue (vs));
vStringDelete (vs);
}
vStringTerminate (vs);
result = xMalloc (vStringLength (vs) + 1, char);
strcpy (result, vStringValue (vs));
vStringDelete (vs);
}
return result;
}
Expand Down

0 comments on commit 046e67b

Please sign in to comment.