diff options
-rw-r--r-- | input.c | 2 | ||||
-rw-r--r-- | startmode.c | 10 |
2 files changed, 9 insertions, 3 deletions
@@ -8,7 +8,7 @@ #include "i_validation.h" #include <stdint.h> -int clfstdin_doubleprint; // variable accessed via extern int in startmode so that it does not print '?' 2 times in a row +int clfstdin_doubleprint = 1; // variable accessed via extern int in startmode so that it does not print '?' 2 times in a row int check_length_fix_stdin(char *smode_buf) { diff --git a/startmode.c b/startmode.c index 1711d1c..e76b991 100644 --- a/startmode.c +++ b/startmode.c @@ -9,6 +9,8 @@ #include "process_multiples.h" #include <stdint.h> +extern int clfstdin_doubleprint; + int ncat(char filename[]) { FILE *file; @@ -89,6 +91,7 @@ int call_singles(char single, uint64_t focus, char *filename) { } int startmode(char filename[]) { + // The entry to the program. Count lines and display the count. Also show which file is being edited. uint64_t Flines; int dnl = display_name_linecount(filename); @@ -135,8 +138,11 @@ int startmode(char filename[]) { free(multiple); break; case _FAIL: - extern int clfstdin_doubleprint; - if (clfstdin_doubleprint == 0) { break ;} + + if (clfstdin_doubleprint == 0) { + clfstdin_doubleprint = 1; + break; + } fprintf(stdout, "?\n"); break; case _RETURN: // if user just preses 'return' button |