From f1ae9edd0de8ad6ff49719c00ebe1d051aea43a4 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 30 Oct 2016 23:30:22 +0100 Subject: [PATCH] core: Fix quasisyntax reading. * mes.c (readword): Avoid unspecified behaviour in comma list. --- mes.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mes.c b/mes.c index b47d02be..47feb1f7 100644 --- a/mes.c +++ b/mes.c @@ -972,12 +972,10 @@ readword (int c, scm *w, scm *a) &scm_nil));} return cons (lookup (symbol_unsyntax.string, a), cons (readword (getchar (), w, a), &scm_nil)); } - if (c == '#' - && (peekchar () == '\'' - || peekchar () == '`') - && w == &scm_nil) {return cons (lookup (cons (make_char ('#'), cons (make_char (getchar ()), &scm_nil)), a), - cons (readword (getchar (), w, a), - &scm_nil));} + if (c == '#' && (peekchar () == '\'' || peekchar () == '`') && w == &scm_nil) { + c = getchar (); + return cons (lookup (cons (make_char ('#'), cons (make_char (c), &scm_nil)), a), + cons (readword (getchar (), w, a), &scm_nil));} if (c == ';') {readcomment (c); return readword ('\n', w, a);} if (c == '#' && peekchar () == 'x') {getchar (); return read_hex ();} if (c == '#' && peekchar () == '\\') {getchar (); return read_character ();}