Fix incorrect check in WCMD_HandleTildaModifiers().

Gerald Pfeifer gerald at pfeifer.com
Mon Jun 15 12:05:33 CDT 2009


On Thu, 11 Jun 2009, Alexandre Julliard wrote:
>>>= '0' || <= '9' always is true. :-)  This patch fixes it, and
>> avoids two just hand coded checks altogether.
>> ChangeLog:
>> Fix incorrect check in WCMD_HandleTildaModifiers().
> Using isdigit() on a Unicode char is not a good idea (and in this case
> isdigitW() wouldn't be a good idea either).

Fair enough, so I guess the following minimal patch is what you are 
looking for to fix this bug?

Gerald

diff --git a/programs/cmd/batch.c b/programs/cmd/batch.c
index 4c089ca..157ad08 100644
--- a/programs/cmd/batch.c
+++ b/programs/cmd/batch.c
@@ -366,7 +366,7 @@ void WCMD_HandleTildaModifiers(WCHAR **start, WCHAR *forVariable, WCHAR *forValu
     WINE_TRACE("Looking backwards for parameter id: %s / %s\n",
                wine_dbgstr_w(lastModifier), wine_dbgstr_w(forVariable));
 
-    if (!justFors && context && (*lastModifier >= '0' || *lastModifier <= '9')) {
+    if (!justFors && context && (*lastModifier >= '0' && *lastModifier <= '9')) {
       /* Its a valid parameter identifier - OK */
       break;
 



More information about the wine-patches mailing list