From a1d37ba46971ed953a0b89148c45d4d1cbe52ca3 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 24 Jul 2013 10:37:55 +0200 Subject: [PATCH] Inline protocol improved to accept quoted strings. --- src/networking.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/networking.c b/src/networking.c index 23ada454..992de156 100644 --- a/src/networking.c +++ b/src/networking.c @@ -829,7 +829,7 @@ void resetClient(redisClient *c) { int processInlineBuffer(redisClient *c) { char *newline = strstr(c->querybuf,"\r\n"); int argc, j; - sds *argv; + sds *argv, aux; size_t querylen; /* Nothing to do without a \r\n */ @@ -843,7 +843,9 @@ int processInlineBuffer(redisClient *c) { /* Split the input buffer up to the \r\n */ querylen = newline-(c->querybuf); - argv = sdssplitlen(c->querybuf,querylen," ",1,&argc); + aux = sdsnewlen(c->querybuf,querylen); + argv = sdssplitargs(aux,&argc); + sdsfree(aux); /* Leave data after the first line of the query in the buffer */ c->querybuf = sdsrange(c->querybuf,querylen+2,-1);