From 4021c78435ab6044ed78ef06e46bf075beb2a959 Mon Sep 17 00:00:00 2001 From: Oskar Date: Thu, 4 Apr 2024 21:03:52 +0200 Subject: Did some changes to the external variable so that it resets to 1 each time. --- startmode.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'startmode.c') 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 +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 -- cgit v1.2.3