Skip to content

Commit

Permalink
Ignore blank lines.
Browse files Browse the repository at this point in the history
--HG--
branch : calculator-experiment
  • Loading branch information
icculus committed Feb 8, 2010
1 parent 6735007 commit 8c720f9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion calculator.c
Expand Up @@ -539,7 +539,9 @@ int main(int argc, char **argv)

while ((ln = fgetln(io, &len)) != NULL)
{
if ((len == 5) && (memcmp(ln, "quit\n", 5) == 0))
if (len == 1)
continue;
else if ((len == 5) && (memcmp(ln, "quit\n", 5) == 0))
break;
else if ((len == 2) && (memcmp(ln, "q\n", 2) == 0))
break;
Expand Down

0 comments on commit 8c720f9

Please sign in to comment.