summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/io.c b/io.c
index a112656129..79f37c9d20 100644
--- a/io.c
+++ b/io.c
@@ -3037,9 +3037,10 @@ argf_getline(argc, argv)
next_p = 1;
goto retry;
}
- gets_lineno++;
- lineno = INT2FIX(gets_lineno);
-
+ if (!NIL_P(line)) {
+ gets_lineno++;
+ lineno = INT2FIX(gets_lineno);
+ }
return line;
}