提交 d8d528e9 编写于 作者: A antirez

quick and dirty fix for hiredis bug creating problem with the new redis-cli...

quick and dirty fix for hiredis bug creating problem with the new redis-cli connect commmand. Also change prompt when redis-cli is not connected
上级 efcf948c
......@@ -664,6 +664,7 @@ void __redisSetError(redisContext *c, int type, const sds errstr) {
static redisContext *redisContextInit() {
redisContext *c = calloc(sizeof(redisContext),1);
c->fd = -1; /* quick fix for a bug that should be addressed differently */
c->err = 0;
c->errstr = NULL;
c->obuf = sdsempty();
......
......@@ -412,7 +412,7 @@ static void repl() {
sds *argv;
config.interactive = 1;
while((line = linenoise("redis> ")) != NULL) {
while((line = linenoise(context ? "redis> " : "not connected> ")) != NULL) {
if (line[0] != '\0') {
argv = sdssplitargs(line,&argc);
linenoiseHistoryAdd(line);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册