From 8c720f9ec2d698ccd56056e684b95128d1234526 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 8 Feb 2010 03:59:18 -0500 Subject: [PATCH] Ignore blank lines. --HG-- branch : calculator-experiment --- calculator.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/calculator.c b/calculator.c index 94e1148e..a6a1e8f7 100644 --- a/calculator.c +++ b/calculator.c @@ -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;