mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-30 05:53:45 +00:00
cmd: Enable '%0' through '%9' as valid FOR loop variables.
Note: there are many other letters than can be used as variable names. Signed-off-by: Eric Pouech <epouech@codeweavers.com>
This commit is contained in:
parent
dc7e8da528
commit
2b51e5aca0
|
@ -613,8 +613,8 @@ N
|
|||
@todo_wine@foo
|
||||
@todo_wine@bar
|
||||
--- in digit variables
|
||||
@todo_wine@a %1 %2
|
||||
@todo_wine@b %1 %2
|
||||
a %1 %2
|
||||
b %1 %2
|
||||
------------ Testing parameter zero ------------
|
||||
:func parm1
|
||||
[:func] [@drive@] [@path@] [test] [.cmd] [@drive@@shortpath@test.cmd]
|
||||
|
|
|
@ -266,12 +266,13 @@ typedef struct _DIRECTORY_STACK
|
|||
|
||||
/* Data structure to for loop variables during for body execution, bearing
|
||||
in mind that for loops can be nested */
|
||||
#define MAX_FOR_VARIABLES 52
|
||||
#define MAX_FOR_VARIABLES (2*26+10)
|
||||
|
||||
static inline int for_var_char_to_index(WCHAR c)
|
||||
{
|
||||
if (c >= L'a' && c <= L'z') return c - L'a';
|
||||
if (c >= L'A' && c <= L'Z') return c - L'A' + 26;
|
||||
if (c >= L'0' && c <= L'9') return c - L'0' + 2 * 26;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -279,7 +280,8 @@ static inline WCHAR for_var_index_to_char(int var_idx)
|
|||
{
|
||||
if (var_idx < 0 || var_idx >= MAX_FOR_VARIABLES) return L'?';
|
||||
if (var_idx < 26) return L'a' + var_idx;
|
||||
return L'A' + var_idx - 26;
|
||||
if (var_idx < 52) return L'A' + var_idx - 26;
|
||||
return L'0' + var_idx - 52;
|
||||
}
|
||||
|
||||
/* check that the range [var_idx, var_idx + var_offset] is a contiguous range */
|
||||
|
|
Loading…
Reference in a new issue