[libpng16] Ignore "#" delimited comments in input file to pnm2png.c.

This commit is contained in:
Glenn Randers-Pehrson
2013-05-07 14:25:21 -05:00
parent 34df4eb5ad
commit 6ab1f4903f
3 changed files with 11 additions and 1 deletions

View File

@@ -462,10 +462,18 @@ void get_token(FILE *pnm_file, char *token)
int i = 0;
int ret;
/* remove white-space */
/* remove white-space and comment lines */
do
{
ret = fgetc(pnm_file);
if (ret == '#') {
/* the rest of this line is a comment */
do
{
ret = fgetc(pnm_file);
}
while ((ret != '\n') && (ret != '\r') && (ret != EOF));
}
if (ret == EOF) break;
token[i] = (unsigned char) ret;
}