Paul Vriens paul.vriens.wine@gmail.com writes:
diff --git a/programs/cmd/batch.c b/programs/cmd/batch.c index 28744d4..6cb732c 100644 --- a/programs/cmd/batch.c +++ b/programs/cmd/batch.c @@ -91,7 +91,7 @@ void WCMD_batch (WCHAR *file, WCHAR *command, int called, WCHAR *startLabel, HAN prev_context = context; context = LocalAlloc (LMEM_FIXED, sizeof (BATCH_CONTEXT)); context -> h = h;
- context->batchfileW = WCMD_strdupW(string);
- context->batchfileW = WCMD_strdupW(file);
That whole function is broken, it should not be lowering the string in the first place. It does this in order to use strstrW, but that's not the right way to check the extension anyway.
In any case the test environment needs to be comparing paths in a case-insensitive way, it doesn't make sense to require exact case.
On 02/18/2010 02:51 PM, Alexandre Julliard wrote:
Paul Vrienspaul.vriens.wine@gmail.com writes:
diff --git a/programs/cmd/batch.c b/programs/cmd/batch.c index 28744d4..6cb732c 100644 --- a/programs/cmd/batch.c +++ b/programs/cmd/batch.c @@ -91,7 +91,7 @@ void WCMD_batch (WCHAR *file, WCHAR *command, int called, WCHAR *startLabel, HAN prev_context = context; context = LocalAlloc (LMEM_FIXED, sizeof (BATCH_CONTEXT)); context -> h = h;
- context->batchfileW = WCMD_strdupW(string);
- context->batchfileW = WCMD_strdupW(file);
That whole function is broken, it should not be lowering the string in the first place. It does this in order to use strstrW, but that's not the right way to check the extension anyway.
I'm not even sure the extension checking is needed as the extension already seems to be present when calling WCMD_batch.
In any case the test environment needs to be comparing paths in a case-insensitive way, it doesn't make sense to require exact case.
So the memcmp needs to change into some strcmp form?
Paul Vriens paul.vriens.wine@gmail.com writes:
In any case the test environment needs to be comparing paths in a case-insensitive way, it doesn't make sense to require exact case.
So the memcmp needs to change into some strcmp form?
Yes, though you probably need CompareString.
On 02/18/2010 03:33 PM, Alexandre Julliard wrote:
Paul Vrienspaul.vriens.wine@gmail.com writes:
In any case the test environment needs to be comparing paths in a case-insensitive way, it doesn't make sense to require exact case.
So the memcmp needs to change into some strcmp form?
Yes, though you probably need CompareString.
Could you think of a reason we need the extension checking in WCMD_batch() ?
I did some (small) tests and it seems like we could remove those checks as WCMD_run_program() already seems to figure this out when it calls WCMD_batch().
The attached patch gets rid of the checks and my tests still pass.
My test was "wine cmd /c test".
Where test.cmd: == CALL test1 ==
test1.cmd:
== goto gotoreg exit
:gotoreg CALL :callreg CALL :callreg CALL test2 exit
:callreg CALL reg ==
And test2.bat:
== echo %~dp0 ==
Paul Vriens paul.vriens.wine@gmail.com writes:
On 02/18/2010 03:33 PM, Alexandre Julliard wrote:
Paul Vrienspaul.vriens.wine@gmail.com writes:
In any case the test environment needs to be comparing paths in a case-insensitive way, it doesn't make sense to require exact case.
So the memcmp needs to change into some strcmp form?
Yes, though you probably need CompareString.
Could you think of a reason we need the extension checking in WCMD_batch() ?
I did some (small) tests and it seems like we could remove those checks as WCMD_run_program() already seems to figure this out when it calls WCMD_batch().
It looks like it's not needed. The case of calling a label in the same file would still set the wrong name, but not worse than it is now...