Permalink
Browse files

Fix adding bulk reply when getcwd fails

  • Loading branch information...
1 parent 9c3a898 commit a830d941a7f6bb56808d3af6b934efc24d096df9 @pietern pietern committed with Jul 27, 2011
Showing with 4 additions and 5 deletions.
  1. +4 −5 src/config.c
View
@@ -526,12 +526,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)) {

0 comments on commit a830d94

Please sign in to comment.