fileio: Skip the whole line after a non quoted comment

feature/tap-sh
Baptiste Daroussin 2015-04-23 21:59:02 +02:00
parent 1dc28ba666
commit 0eb31f91ee
1 changed files with 7 additions and 2 deletions

View File

@ -36,9 +36,14 @@ pkg_fgetline(char *line, size_t size, FILE *stream)
} }
else if (c == '#') else if (c == '#')
{ {
if (!quoted) if (!quoted) {
/* Skip the rest of the line */
do {
c = getc(stream);
} while (c != '\n' && c != EOF);
*s++ = c;
break; break;
}
quoted = false; quoted = false;
continue; continue;
} }