From 62e6f6c29af513c067f5727b8b5545840daa9806 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Wed, 27 Jul 2011 15:03:48 +0200 Subject: [PATCH] Fix adding bulk reply when getcwd fails --- src/config.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/config.c b/src/config.c index 44c0e21d5..f2b0d312a 100644 --- a/src/config.c +++ b/src/config.c @@ -483,12 +483,11 @@ void configGetCommand(redisClient *c) { if (stringmatch(pattern,"dir",0)) { char buf[1024]; - addReplyBulkCString(c,"dir"); - if (getcwd(buf,sizeof(buf)) == NULL) { + if (getcwd(buf,sizeof(buf)) == NULL) buf[0] = '\0'; - } else { - addReplyBulkCString(c,buf); - } + + addReplyBulkCString(c,"dir"); + addReplyBulkCString(c,buf); matches++; } if (stringmatch(pattern,"dbfilename",0)) {