aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2019-01-10 11:04:40 +0100
committerJohn Ankarström <john@ankarstrom.se>2019-01-10 11:04:40 +0100
commit20170d4e43032620774cc729c854daffbc1075ad (patch)
treed63b737e0045e067311be96f9722325b05648324
parenteeef33a2327f0ebe6a83b2be9f6b0367c06ca39c (diff)
downloadrepl-20170d4e43032620774cc729c854daffbc1075ad.tar.gz
don't add to history on empty input
-rw-r--r--repl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/repl.c b/repl.c
index 1788fdf..1fcca4a 100644
--- a/repl.c
+++ b/repl.c
@@ -38,7 +38,7 @@ int main(int argc, char *argv[]) {
break;
}
- add_history(input);
+ if (input[0] != '\0') add_history(input);
int size = strlen(argv[1]) + 1 + strlen(input) + 1;
char *command = malloc(size);