# HG changeset patch # User William Astle # Date 1639961162 25200 # Node ID 56c32bc798f89542a27826b6d3323e8e2e810146 # Parent 63450eb68f45da861e49a00c75e0ec0c047aff3e Fix argument parsing problems with IFSTR Neglecting to take into account comma separators and opening delimiters led to a number of off by one errors making IFSTR largely useless. diff -r 63450eb68f45 -r 56c32bc798f8 lwasm/pseudo.c --- a/lwasm/pseudo.c Sun Dec 19 17:09:15 2021 -0700 +++ b/lwasm/pseudo.c Sun Dec 19 17:46:02 2021 -0700 @@ -1839,8 +1839,10 @@ if (tstr[i]) i++; + if (tstr[i] == ',') + i++; - *p += i; + *p += i + 1; return arg; } else if (*tstr == '\'') @@ -1856,8 +1858,9 @@ if (tstr[i]) i++; - - *p += i; + if (tstr[i] == ',') + i++; + *p += i + 1; return arg; } else @@ -1887,7 +1890,7 @@ arg1 = strcond_parsearg(p); arg2 = strcond_parsearg(p); - + if (strcmp(arg1, arg2) == 0) c = 1; lw_free(arg1);