diff --git a/ANNOUNCE b/ANNOUNCE index baafd51cb..de4f88b08 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -52,6 +52,7 @@ Version 1.6.3beta05 [May 7, 2013] Zlib-1.2.8 and earlier don't allow us to decrease the windowBits, so undid the improvement in beta04. Check for EOF in contrib/pngminus/pnm2png.c (Paul Stewart). + Ignore "#" delimited comments in input file to pnm2png.c. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index a263feb12..72c987411 100644 --- a/CHANGES +++ b/CHANGES @@ -4535,6 +4535,7 @@ Version 1.6.3beta05 [May 7, 2013] Zlib-1.2.8 and earlier don't allow us to decrease the windowBits, so undid the improvement in beta04. Check for EOF in contrib/pngminus/pnm2png.c (Paul Stewart). + Ignore "#" delimited comments in input file to pnm2png.c. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/contrib/pngminus/pnm2png.c b/contrib/pngminus/pnm2png.c index 76f394fbb..953011223 100644 --- a/contrib/pngminus/pnm2png.c +++ b/contrib/pngminus/pnm2png.c @@ -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; }