diff options
author | Robby Zambito <contact@robbyzambito.me> | 2022-01-21 17:26:43 -0500 |
---|---|---|
committer | Robby Zambito <contact@robbyzambito.me> | 2022-01-21 17:26:43 -0500 |
commit | 1156ea42110ef7bb3d2d73aec1c7ef2344d0900a (patch) | |
tree | 4ce31eb3dfe6fb3ca03b795932d6387d96595714 | |
parent | f1a4b5757f0d20739270b22726ebf8442b13cb50 (diff) |
Don't add empty strings to the history
-rw-r--r-- | src/move.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -63,7 +63,9 @@ struct move prompt_get_move(enum player_color current_player) { char *input = readline(prompt); if (input != NULL) { - add_history(input); + if (strlen(input) > 0) { + add_history(input); + } if (STREQ(input, "h")) { print_help(); } else if (STREQ(input, "p")) { |