aboutsummaryrefslogtreecommitdiff
path: root/src/tokenize.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tokenize.c')
-rw-r--r--src/tokenize.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/tokenize.c b/src/tokenize.c
index 122e61440..77d760003 100644
--- a/src/tokenize.c
+++ b/src/tokenize.c
@@ -15,7 +15,7 @@
** individual tokens and sends those tokens one-by-one over to the
** parser for analysis.
**
-** $Id: tokenize.c,v 1.71 2004/05/27 09:28:43 danielk1977 Exp $
+** $Id: tokenize.c,v 1.72 2004/05/27 13:35:20 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -377,14 +377,19 @@ static int sqliteGetToken(const unsigned char *z, int *tokenType){
}
case 'x': case 'X': {
if( z[1]=='\'' || z[1]=='"' ){
- int delim = z[0];
- for(i=1; z[i]; i++){
+ int delim = z[1];
+ *tokenType = TK_BLOB;
+ for(i=2; z[i]; i++){
if( z[i]==delim ){
+ if( i%2 ) *tokenType = TK_ILLEGAL;
break;
}
+ if( !isxdigit(z[i]) ){
+ *tokenType = TK_ILLEGAL;
+ return i;
+ }
}
if( z[i] ) i++;
- *tokenType = TK_BLOB;
return i;
}
/* Otherwise fall through to the next case */