mirror of
https://github.com/fluencelabs/redis
synced 2025-06-17 19:21:21 +00:00
GETRANGE: return empty string with negative, inverted start/end.
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user