diff options
author | antirez <antirez@gmail.com> | 2016-06-15 12:48:58 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2016-06-15 12:48:58 +0200 |
commit | 2d86995273e431b40c2bd30c694ea405cc698118 (patch) | |
tree | 6db769a82f96a377bf64aee86a6203aa282e18ff /src/t_string.c | |
parent | eb45e114965175e766136d6e0d8fbe242bc256b1 (diff) | |
download | redis-2d86995273e431b40c2bd30c694ea405cc698118.tar.gz |
GETRANGE: return empty string with negative, inverted start/end.
Diffstat (limited to 'src/t_string.c')
-rw-r--r-- | src/t_string.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/t_string.c b/src/t_string.c index 35eb9d7c1..8c737c4e3 100644 --- a/src/t_string.c +++ b/src/t_string.c @@ -263,6 +263,10 @@ void getrangeCommand(client *c) { } /* Convert negative indexes */ + if (start < 0 && end < 0 && start > end) { + addReply(c,shared.emptybulk); + return; + } if (start < 0) start = strlen+start; if (end < 0) end = strlen+end; if (start < 0) start = 0; |