From e42a9e6b5c2ea61debd257678ab6a442233693a1 Mon Sep 17 00:00:00 2001 From: Giles Atkinson <“gatk555@gmail.com”> Date: Sat, 28 Mar 2026 08:00:37 +0000 Subject: [PATCH] Fix excessive forcing to lower-case in pure script files. Add string comparisons as protected commands so they can be case-sensitive. --- src/frontend/inpcom.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 5af0e027b..26e37d7ec 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1343,6 +1343,7 @@ static struct inp_read_t inp_read(FILE* fp, int call_depth, const char* dir_name bool found_end = FALSE, shell_eol_continuation = FALSE; static bool biaswarn = FALSE; static bool hdlwarn = FALSE; + bool first = TRUE; #ifdef CIDER static int in_cider_model = 0; #endif @@ -1403,7 +1404,15 @@ static struct inp_read_t inp_read(FILE* fp, int call_depth, const char* dir_name /* OK -- now we have loaded the next line into 'buffer'. Process it. */ - /* If input line is blank, ignore it & continue looping. */ + if (first) { + /* Files starting *ng_script are user supplied command files. */ + + if (ciprefix("*ng_script", buffer)) + comfile = TRUE; + first = FALSE; + } + + /* If input line is blank, ignore it & continue looping. */ if ((strcmp(buffer, "\n") == 0) || (strcmp(buffer, "\r\n") == 0)) if (call_depth != 0 || (call_depth == 0 && cc != NULL)) { line_number_orig++; @@ -1792,8 +1801,10 @@ static struct inp_read_t inp_read(FILE* fp, int call_depth, const char* dir_name ciprefix("osdi", buffer) || ciprefix("pre_osdi", buffer) || ciprefix("echo", buffer) || ciprefix("shell", buffer) || - ciprefix("source", buffer) ||ciprefix("cd", buffer) || - ciprefix("load", buffer) || ciprefix("setcs", buffer))))) { + ciprefix("source", buffer) || ciprefix("cd", buffer) || + ciprefix("load", buffer) || ciprefix("setcs", buffer) || + ciprefix("strcmp", buffer) || + ciprefix("strstr", buffer))))) { /* lower case for all other lines */ for (s = buffer; *s && (*s != '\n'); s++) *s = tolower_c(*s);