Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
Fix adding bulk reply when getcwd fails
Browse files Browse the repository at this point in the history
  • Loading branch information
pietern authored and antirez committed Jul 27, 2011
1 parent 9c3a898 commit a830d94
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/config.c
Expand Up @@ -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)) {
Expand Down

0 comments on commit a830d94

Please sign in to comment.