summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--input.c2
-rw-r--r--startmode.c10
2 files changed, 9 insertions, 3 deletions
diff --git a/input.c b/input.c
index c94aaa3..41ff0f5 100644
--- a/input.c
+++ b/input.c
@@ -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