commit e9ddc3ba0b86069b55b0d2bf51f3510f2efd11d3
parent cc12adaa0f8747743a46b65f6d1221b654701d7e
Author: kocotian <kocotian@kocotian.pl>
Date: Sat, 20 Mar 2021 20:49:48 +0100
getVariableValue() now starts reading variables from the end
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/generate.c b/generate.c
@@ -39,8 +39,8 @@ getVariableValue(char *v)
{
size_t n;
String s = { .data = v, .len = strlen(v) };
- n = -1;
- while (++n < vss) {
+ n = vss;
+ while (--n >= 0) {
if (!Strcmp(vs[n].name, s))
return vs[n].value;
}