shithub: rc

Download patch

ref: a827beee910cb143f916cf3657c45c29d904800c
parent: 69041639483e16392e3013491fcb382efd2b9374
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Jan 19 17:24:57 EST 2025

rc: count split line numbers correctly

When we split a line with \, we would forget to
increment the line number. As a result, the line
number printed in error messages was incorrect.

Fix it.

--- a/lex.c
+++ b/lex.c
@@ -81,6 +81,7 @@
 	if(c=='\\' && !lex->inquote){
 		c = rchr(lex->input);
 		if(c=='\n' && !lex->incomm){		/* don't continue a comment */
+			lex->line++;
 			doprompt = 1;
 			c=' ';
 		}