("Set lower case for variables or vectors in command 'echo'.
Tokens starting with '$' will get lower-casing.", 2024-09-07)

Don't use s as name for temporary string, as s has been set
already and is used later.
This commit is contained in:
Holger Vogt 2024-09-13 11:35:28 +02:00
parent b62528d7e5
commit d5f0c6598f
1 changed files with 5 additions and 5 deletions

View File

@ -1669,14 +1669,14 @@ static struct inp_read_t inp_read(FILE* fp, int call_depth, const char* dir_name
} }
/* lower case for variables or vectors in command 'echo' */ /* lower case for variables or vectors in command 'echo' */
if (ciprefix("echo", buffer)) { if (ciprefix("echo", buffer)) {
char* p = buffer; char* p = buffer, *tmpstr;
while (p && *p != '\n' && *p != '\0') { while (p && *p != '\n' && *p != '\0') {
p = nexttok(p); p = nexttok(p);
/* vectors or variables start with $ */ /* vectors or variables start with $ */
if (p && *p == '$') { if (p && *p == '$') {
for (s = p; *s && !isspace_c(*s); s++) for (tmpstr = p; *tmpstr && !isspace_c(*tmpstr); tmpstr++)
*s = tolower_c(*s); *tmpstr = tolower_c(*tmpstr);
p = s; p = tmpstr;
} }
} }
} }
@ -1961,7 +1961,7 @@ char *inp_pathresolve(const char *name)
/* Figure out if name starts with: environmental variables (replace them), /* Figure out if name starts with: environmental variables (replace them),
~/ (expand the tilde), absolute path name, all others and return the absolute path name, ~/ (expand the tilde), all others and return the
path, if file exists. */ path, if file exists. */
static char *inp_pathresolve_at(const char *name, const char *dir) static char *inp_pathresolve_at(const char *name, const char *dir)
{ {