On Sun, Aug 28, 2011 at 00:39, Octavian Voicu octavian.voicu@gmail.com wrote:
Fixes an infinite recursion when running a command such as "del file.txt /S" in a directory that has some subdirectory with a colon in its name.
The filename:stream syntax can be used on native to access alternate data streams on NTFS partitions. Such support would obviously need to be implemented by the underlying filesystem, so there is no point in parsing this is Wine.
programs/cmd/batch.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/programs/cmd/batch.c b/programs/cmd/batch.c index 03c92ee..bbefcfb 100644 --- a/programs/cmd/batch.c +++ b/programs/cmd/batch.c @@ -222,8 +222,8 @@ void WCMD_splitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHA } else if (drv) *drv = '\0';
- /* search for end of string or stream separator */
- for(end=path; *end && *end!=':'; )
- /* search for end of string */
- for(end=path; *end; )
end++;
/* search for begin of file extension */
Might be a good idea to add a simple testcase
2011/8/29 Frédéric Delanoy frederic.delanoy@gmail.com
Might be a good idea to add a simple testcase
Not sure yet how native is going to handle this, because windows doesn't allow colons in filenames. I submitted a job to the testbot to check this [1].
Alexandre already committed the patch, so if native passes the test I can send a test for the next iteration. On the other hand, if native chokes on the colon, then we shouldn't add any testcases. If it works, might also throw a @pwd@ in there.
Octavian
2011/8/29 Octavian Voicu octavian.voicu@gmail.com
Alexandre already committed the patch, so if native passes the test I can send a test for the next iteration. On the other hand, if native chokes on the colon, then we shouldn't add any testcases. If it works, might also throw a @pwd@ in there.
I've got the results, see [2]. I tried doing cd to a foo:bar directory, but it fails on Windows. Not sure what's with all the extra failures, but except tests on NT (where %cd% is broken) the second %cd% shows that either the directory was not created, or cd failed to that directory.
I guess we could throw in the test without the echo %cd% part, but I'm not sure if it wouldn't affect subsequent tests -- if cd fails, then cd .. will go one level upper. Not sure if the test is worth the trouble...
Octavian
2011/8/30 Octavian Voicu octavian.voicu@gmail.com:
2011/8/29 Octavian Voicu octavian.voicu@gmail.com
Alexandre already committed the patch, so if native passes the test I can send a test for the next iteration. On the other hand, if native chokes on the colon, then we shouldn't add any testcases. If it works, might also throw a @pwd@ in there.
I've got the results, see [2]. I tried doing cd to a foo:bar directory, but it fails on Windows. Not sure what's with all the extra failures, but except tests on NT (where %cd% is broken) the second %cd% shows that either the directory was not created, or cd failed to that directory. I guess we could throw in the test without the echo %cd% part, but I'm not sure if it wouldn't affect subsequent tests -- if cd fails, then cd .. will go one level upper. Not sure if the test is worth the trouble...
%CD% indeed doesn't work on NT4, and there is a test for that already IIRC. You can circumvent that with @pwd@ (starting path) [just using "cd" is equivalent to "echo %cd%" and works everywhere] An interesting test would be to use stuff like C:foo or Z:\foo for regressions (or more portably @drive@)
Also don"t put stuff like "ECHO is off" in expected file, that's not portable on non-English locales
You can use quotes, like e.g. echo 'whatever'
Frédéric