cmd: Add helper for 'if' comparison operations evaluation (try 2)
Octavian Voicu
octavian.voicu at gmail.com
Mon Nov 7 04:21:21 CST 2011
2011/11/7 Frédéric Delanoy <frederic.delanoy at gmail.com>:
> + /* Note: '==' can't be returned by WCMD_parameter since '=' is a separator */
> + p = paramEnd + 1;
> + while (*p == ' ' || *p == '\t')
> + p++;
> +
> + if (!p || *p != '=' || !(p+1) || *(p+1) != '=')
> + goto syntax_err;
> +
> + strcpyW(operator, eqeqW);
> + p += strlenW(operator);
Hi,
This doesn't look general enough, I'm not sure how you want to handle
the other operators. Wouldn't it be better to just find next space/tab
(skip all non-whitespace chars) then assign the part of the string
separated by whitespace to be the operator? With this approach you
also don't need that syntax check there.
Octavian
More information about the wine-devel
mailing list