summaryrefslogtreecommitdiffstats
path: root/parser.l
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2009-11-13 09:33:27 -0800
committerKaz Kylheku <kaz@kylheku.com>2009-11-13 09:33:27 -0800
commit95e59dd555a038fd6eb70bc38e4e921d811b1f49 (patch)
treef3dc2ec7704ff24903618ed4ca5b09e5a1c2e5e8 /parser.l
parent673d5f3b84d276fb29233d6a3f485ccfe330be13 (diff)
downloadtxr-95e59dd555a038fd6eb70bc38e4e921d811b1f49.tar.gz
txr-95e59dd555a038fd6eb70bc38e4e921d811b1f49.tar.bz2
txr-95e59dd555a038fd6eb70bc38e4e921d811b1f49.zip
Previous commit broke UTF-8 lexing, by changing the get_char
semantics on the input stream to wide character input. Also, reading a query the command line (-c) must read bytes from a UTF-8 encoding of the string. We introduce a new get_byte function which can extract bytes from streams which provide it.
Diffstat (limited to 'parser.l')
-rw-r--r--parser.l4
1 files changed, 2 insertions, 2 deletions
diff --git a/parser.l b/parser.l
index 801185f0..39392d7f 100644
--- a/parser.l
+++ b/parser.l
@@ -48,8 +48,8 @@
obj_t *c = nil; \
int n, ch = '*'; \
for (n = 0; n < max_size && \
- (c = get_char(yyin_stream)) && \
- (ch = c_chr(c)) != '\n'; ++n) \
+ (c = get_byte(yyin_stream)) && \
+ (ch = c_num(c)) != '\n'; ++n) \
buf[n] = (char) ch; \
if (ch == '\n') \
buf[n++] = (char) ch; \