Skip to content

Commit

Permalink
GH-62 GH-63 Fix alineInput() hard coded stdin references.
Browse files Browse the repository at this point in the history
  • Loading branch information
SirWumpus committed Nov 8, 2024
1 parent cd162f5 commit 593797c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/aline.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ alineInput(FILE *fp, const char *prompt, char *buf, size_t size)
#ifdef HAVE_CTERMID
ch = alineReadByte();
#else
clearerr(stdin);
ch = fgetc(stdin);
clearerr(fp);
ch = fgetc(fp);
#endif
if (ch == EOF || ch == tty_saved.c_cc[VEOL] || ch == '\r' || ch == '\n') {
(void) fputs("\r\n", stdout);
Expand All @@ -211,8 +211,8 @@ alineInput(FILE *fp, const char *prompt, char *buf, size_t size)
if ((ch = alineReadByte()) == '[') {
ch = alineReadByte();
#else
if ((ch = fgetc(stdin)) == '[') {
ch = fgetc(stdin);
if ((ch = fgetc(fp)) == '[') {
ch = fgetc(fp);
#endif
if (ch == 'A') {
ch = '\v';
Expand Down

0 comments on commit 593797c

Please sign in to comment.