shithub: riscv

Download patch

ref: 433249b227bf57b45cd5b40b1e6b69c26b89bc78
parent: 54031c9e3df5107c71d7fb69908dd1aa5158545d
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/sys/src/cmd/rc/lex.c
+++ b/sys/src/cmd/rc/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=' ';
 		}
--