Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
ed10f40b
Commit
ed10f40b
authored
Dec 15, 2009
by
antirez
Browse files
Unified handling of empty queries with normal queries.
parent
7c49733c
Changes
2
Hide whitespace changes
Inline
Side-by-side
redis.c
View file @
ed10f40b
...
...
@@ -1877,12 +1877,6 @@ again:
sdsupdatelen
(
query
);
/* Now we can split the query in arguments */
if
(
sdslen
(
query
)
==
0
)
{
/* Ignore empty query */
sdsfree
(
query
);
if
(
sdslen
(
c
->
querybuf
))
goto
again
;
return
;
}
argv
=
sdssplitlen
(
query
,
sdslen
(
query
),
" "
,
1
,
&
argc
);
sdsfree
(
query
);
...
...
sds.c
View file @
ed10f40b
...
...
@@ -277,6 +277,10 @@ sds *sdssplitlen(char *s, int len, char *sep, int seplen, int *count) {
if
(
tokens
==
NULL
)
sdsOomAbort
();
#endif
if
(
seplen
<
1
||
len
<
0
||
tokens
==
NULL
)
return
NULL
;
if
(
len
==
0
)
{
*
count
=
0
;
return
tokens
;
}
for
(
j
=
0
;
j
<
(
len
-
(
seplen
-
1
));
j
++
)
{
/* make sure there is room for the next element and the final one */
if
(
slots
<
elements
+
2
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment