summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/io.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/io.c b/lisp/io.c
index 3a33855..9db73ee 100644
--- a/lisp/io.c
+++ b/lisp/io.c
@@ -107,13 +107,15 @@ LispUnget(int ch)
{
LispUngetInfo *unget = lisp__data.unget[lisp__data.iunget];
- if (unget->offset == sizeof(unget->buffer)) {
- LispWarning("character %c lost at LispUnget()", unget->buffer[0]);
- memmove(unget->buffer, unget->buffer + 1, unget->offset - 1);
- unget->buffer[unget->offset - 1] = ch;
+ if ((ch & 0xff) == ch) {
+ if (unget->offset == sizeof(unget->buffer)) {
+ LispWarning("character %c lost at LispUnget()", unget->buffer[0]);
+ memmove(unget->buffer, unget->buffer + 1, unget->offset - 1);
+ unget->buffer[unget->offset - 1] = ch;
+ }
+ else
+ unget->buffer[unget->offset++] = ch;
}
- else
- unget->buffer[unget->offset++] = ch;
return (ch);
}