From b62528d7e574778e8d70b15f7840b2305e1d0ff3 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sat, 7 Sep 2024 18:50:13 +0200 Subject: [PATCH] Set lower case for variables or vectors in command 'echo'. Tokens starting with '$' will get lower-casing. --- src/frontend/inpcom.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 5998e2c78..d959a7604 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1667,7 +1667,19 @@ static struct inp_read_t inp_read(FILE* fp, int call_depth, const char* dir_name for (s = buffer; *s && (*s != '\n'); s++) ; } - + /* lower case for variables or vectors in command 'echo' */ + if (ciprefix("echo", buffer)) { + char* p = buffer; + while (p && *p != '\n' && *p != '\0') { + p = nexttok(p); + /* vectors or variables start with $ */ + if (p && *p == '$') { + for (s = p; *s && !isspace_c(*s); s++) + *s = tolower_c(*s); + p = s; + } + } + } /* add Inp_Path to buffer while keeping the sourcepath variable contents */ if (ciprefix("set", buffer)) { char *p;