--- a/jdk/src/windows/bin/cmdtoargs.c Fri May 24 17:15:43 2013 +0800
+++ b/jdk/src/windows/bin/cmdtoargs.c Fri May 24 17:01:08 2013 -0700
@@ -128,7 +128,9 @@
*wildcard = JNI_TRUE;
}
if (prev == '\\') {
- *dest++ = prev;
+ for (i = 0 ; i < slashes ; i++) {
+ *dest++ = prev;
+ }
}
*dest++ = ch;
break;
@@ -184,7 +186,7 @@
argv = (StdArg*) JLI_MemRealloc(argv, (nargs+1) * sizeof(StdArg));
argv[nargs].arg = JLI_StringDup(arg);
argv[nargs].has_wildcard = wildcard;
-
+ *arg = NULL;
nargs++;
} while (src != NULL);
@@ -602,6 +604,14 @@
v->add("d", FALSE);
vectors[i++] = v;
+ v= new Vector(argv[0], "\\\\?");
+ v->add("\\\\?", TRUE);
+ vectors[i++] = v;
+
+ v= new Vector(argv[0], "\\\\*");
+ v->add("\\\\*", TRUE);
+ vectors[i++] = v;
+
dotest(vectors);
printf("All tests pass [%d]\n", i);
doexit(0);
--- a/jdk/test/tools/launcher/Arrrghs.java Fri May 24 17:15:43 2013 +0800
+++ b/jdk/test/tools/launcher/Arrrghs.java Fri May 24 17:01:08 2013 -0700
@@ -24,7 +24,7 @@
/**
* @test
* @bug 5030233 6214916 6356475 6571029 6684582 6742159 4459600 6758881 6753938
- * 6894719 6968053 7151434 7146424
+ * 6894719 6968053 7151434 7146424 8007333
* @summary Argument parsing validation.
* @compile -XDignore.symbol.file Arrrghs.java
* @run main/othervm Arrrghs
@@ -310,6 +310,20 @@
checkArgumentParsing("..\\..\\", "..\\..\\");
checkArgumentParsing("../../", "../../");
checkArgumentParsing("a b\\ c", "a", "b\\", "c");
+ // 2 back-slashes
+ checkArgumentParsing("\\\\?", "\\\\?");
+ // 3 back-slashes
+ checkArgumentParsing("\\\\\\?", "\\\\\\?");
+ // 4 back-slashes
+ checkArgumentParsing("\\\\\\\\?", "\\\\\\\\?");
+ // 5 back-slashes
+ checkArgumentParsing("\\\\\\\\\\?", "\\\\\\\\\\?");
+ // 6 back-slashes
+ checkArgumentParsing("\\\\\\\\\\\\?", "\\\\\\\\\\\\?");
+
+ // more treatment of mixed slashes
+ checkArgumentParsing("f1/ f3\\ f4/", "f1/", "f3\\", "f4/");
+ checkArgumentParsing("f1/ f2\' ' f3/ f4/", "f1/", "f2\'", "'", "f3/", "f4/");
}
private void initEmptyDir(File emptyDir) throws IOException {