summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2011-07-27 15:03:48 +0200
committerantirez <antirez@gmail.com>2011-07-27 16:22:58 +0200
commit62e6f6c29af513c067f5727b8b5545840daa9806 (patch)
treedaa6412588bbd0fec60b7248e81832d7c641809c
parent33d2761bc05710b4dd6d036e04ca1b3c9d4b2a39 (diff)
downloadredis-62e6f6c29af513c067f5727b8b5545840daa9806.tar.gz
Fix adding bulk reply when getcwd fails
-rw-r--r--src/config.c9
1 files 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)) {