From 863d62623f30c404328f4f0329629797eaf81df1 Mon Sep 17 00:00:00 2001 From: nisstyre56 Date: Wed, 9 Jul 2014 02:24:01 -0400 Subject: [PATCH] distinguish the quote character from quoted symbols --- tokenize.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tokenize.c b/tokenize.c index 87b4488..daa1815 100644 --- a/tokenize.c +++ b/tokenize.c @@ -14,21 +14,21 @@ */ static const token_t nulltok = { - .token_type=EMPTY, + .token_type = EMPTY, { .null_token=false } }; static const token_t whitespace_tok = { - .token_type=WSPACE, + .token_type = WSPACE, .token= { .whitespace=true } }; static const token_t quote_tok = { - .token_type=QUOTE, + .token_type = QUOTE, .token= { .quote=true } @@ -272,10 +272,10 @@ match_symbol(source_t source, return false; } i++; - while (!isspace(source[i]) && i <= length) { + while (!isspace(source[i]) && i < length) { i++; } - if (i == begin) { + if (i == begin+1) { /* if we did not increment i more than once (before the loop) */ return false; } return i;