]> git.saurik.com Git - redis.git/commitdiff
Remove trailing newline in interactive mode.
authorDamian Janowski & Michel Martens <damian.janowski+soveran@gmail.com>
Tue, 2 Mar 2010 18:47:31 +0000 (15:47 -0300)
committerDamian Janowski & Michel Martens <damian.janowski+soveran@gmail.com>
Tue, 2 Mar 2010 18:47:31 +0000 (15:47 -0300)
redis-cli.c

index 555c448fd18f375b840c3e389d0130d7930cbc2b..46ee29f0e67c5f2d89a6a63fb429a033695b83e6 100644 (file)
@@ -439,7 +439,10 @@ static char *prompt(char *line, int size) {
         retval = fgets(line, size, stdin);
     } while (retval && *line == '\n');
 
+    line[strlen(line) - 1] = '\0';
+
     fpurge(stdin);
+
     return retval;
 }