shithub: femtolisp

Download patch

ref: 783f049aa71a90b0ea02918e04b30a6b45b6a75e
parent: 212e0968cc531399fb96edef89f34c4cac29078b
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Sun Nov 10 22:56:43 EST 2024

read: nextchar: just call ios_getc

--- a/read.c
+++ b/read.c
@@ -172,13 +172,9 @@
 	ios_t *f = RS;
 
 	do{
-		if(f->bpos < f->size){
-			ch = f->buf[f->bpos++];
-		}else{
-			ch = ios_getc(f);
-			if(ch == IOS_EOF)
-				return 0;
-		}
+		ch = ios_getc(RS);
+		if(ch == IOS_EOF)
+			return 0;
 		c = (char)ch;
 		if(c == ';'){
 			// single-line comment