shithub: femtolisp

Download patch

ref: c1a405e896e96f32877bf43197e98161ddb4aa5f
parent: 04a8d03a708ce1361aada5201c9b87ea5be38b82
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Fri Mar 10 10:33:06 EST 2023

peek: fix wrong condition for a single char

--- a/read.c
+++ b/read.c
@@ -239,7 +239,7 @@
             else if (cval >= 'a' && cval <= 'z') {
                 read_token((char)cval, 0);
                 tokval = symbol(buf);
-                if (buf[1] != '\0') { USED(cval); } /* one character */
+                if (buf[1] == '\0') { USED(cval); } /* one character */
                 else if (tokval == nulsym)        cval = 0x00;
                 else if (tokval == alarmsym)      cval = 0x07;
                 else if (tokval == backspacesym)  cval = 0x08;