Tests for redis-cli in non-interactive mode

Minor change in redis-cli output for the (multi-)bulk response but this
will be fixed in the next commit.
This commit is contained in:
Pieter Noordhuis
2010-08-04 17:02:13 +02:00
parent 0439d792c4
commit 07242c0ccf
2 changed files with 38 additions and 2 deletions

View File

@ -134,7 +134,7 @@ static void printStringRepr(char *s, int len) {
}
s++;
}
printf("\"\n");
printf("\"");
}
static int cliReadBulkReply(int fd) {
@ -152,7 +152,7 @@ static int cliReadBulkReply(int fd) {
reply = zmalloc(bulklen);
anetRead(fd,reply,bulklen);
anetRead(fd,crlf,2);
if (config.raw_output || !config.interactive) {
if (config.raw_output) {
if (bulklen && fwrite(reply,bulklen,1,stdout) == 0) {
zfree(reply);
return 1;
@ -161,6 +161,7 @@ static int cliReadBulkReply(int fd) {
/* If you are producing output for the standard output we want
* a more interesting output with quoted characters and so forth */
printStringRepr(reply,bulklen);
printf("\n");
}
zfree(reply);
return 0;