Skip to content

Commit

Permalink
Fix alineInput() to flush output before getting the cursor position.
Browse files Browse the repository at this point in the history
  • Loading branch information
SirWumpus committed Nov 10, 2024
1 parent 3318475 commit 52d76c1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/aline.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ alineInput(FILE *fp, const char *prompt, char *buf, size_t size)
unsigned i;
int ch, pcol, pos[2], prevline = lastline;

(void) fflush(stdout);
if (!isatty(fileno(fp))) {
*buf = '\0';
clearerr(fp); errno = 0;
Expand Down

0 comments on commit 52d76c1

Please sign in to comment.