More consistent BITPOS behavior with bit=0 and ranges.
More consistent BITPOS behavior with bit=0 and ranges.

With the new behavior it is possible to specify just the start in the
range (the end will be assumed to be the first byte), or it is possible
to specify both start and end.

This is useful to change the behavior of the command when looking for
zeros inside a string.

1) If the user specifies both start and end, and no 0 is found inside
   the range, the command returns -1.

2) If instead no range is specified, or just the start is given, even
   if in the actual string no 0 bit is found, the command returns the
   first bit on the right after the end of the string.

So for example if the string stored at key foo is "\xff\xff":

    BITPOS foo (returns 16)
    BITPOS foo 0 -1 (returns -1)
    BITPOS foo 0 (returns 16)

The idea is that when no end is given the user is just looking for the
first bit that is zero and can be set to 1 with SETBIT, as it is
"available". Instead when a specific range is given, we just look for a
zero within the boundaries of the range.

himoca/redis,louisliangjun/redis,slfs007/mk-redis,ksarch-saas/redis,ramonsnir/redis,xuzhezhaozhao/redis_reading,spearhead-ea/redis,maodeyi/redis_lua,HunanTV/redis,splitice/redis,maodeyi/redis_lua,Hailei/redis,xuzhezhaozhao/redis_reading,Hailei/redis,slfs007/mk-redis,jxwr/redis,ttuna/msot-redis,darksideofthemoo/redis-histogram,MSOpenTech/redis,HunanTV/redis,louisliangjun/redis,splitice/redis,spearhead-ea/redis,xuzhezhaozhao/redis_reading,himoca/redis,himoca/redis,louisliangjun/redis,MSOpenTech/redis,ttuna/msot-redis,ttuna/msot-redis,splitice/redis,spearhead-ea/redis,MSOpenTech/redis,louisliangjun/redis,ttuna/msot-redis,maodeyi/redis_lua,darksideofthemoo/redis-histogram,ksarch-saas/redis,HunanTV/redis,jxwr/redis,slfs007/mk-redis,jxwr/redis,ttuna/msot-redis,ramonsnir/redis,xuzhezhaozhao/redis_reading,splitice/redis,darksideofthemoo/redis-histogram,darksideofthemoo/redis-histogram,ramonsnir/redis,ksarch-saas/redis,Hailei/redis,Hailei/redis,ksarch-saas/redis,HunanTV/redis,MSOpenTech/redis,MSOpenTech/redis