From 6672ecac5847db8010a0351e983963780a4ef8c2 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 13 Oct 2026 20:45:29 +0200 Subject: [PATCH] fix: immediately continue when empty line is read --- src/msh.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/msh.c b/src/msh.c index 062da60..3e62a3c 100644 --- a/src/msh.c +++ b/src/msh.c @@ -469,6 +469,12 @@ int main(int argc, char** argv) { line[linelen] = 0; + if (linelen == 0) { + free(line); + line = NULL; + continue; + } + fprintf(historyfile, "%s\n", line); fflush(historyfile);