Compare commits

..

2 Commits

Author SHA1 Message Date
Michael
6672ecac58 fix: immediately continue when empty line is read 2026-10-13 20:45:29 +02:00
Michael
c8b5621df1 fix: when set, free oldline after reading line 2026-10-13 20:43:44 +02:00

View File

@@ -457,12 +457,24 @@ int main(int argc, char** argv) {
fflush(stdout);
}
// oldline is only valid while reading
if (oldline != NULL) {
free(oldline);
oldline = NULL;
}
putc('\n', stdout);
tcsetattr(fileno(stdin), 0, &orig_term);
line[linelen] = 0;
if (linelen == 0) {
free(line);
line = NULL;
continue;
}
fprintf(historyfile, "%s\n", line);
fflush(historyfile);