File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
apache-maven/src/assembly/maven/bin Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -69,15 +69,17 @@ public static void main(String[] args) {
6969 line = line .replace ("${MAVEN_PROJECTBASEDIR}" , mavenProjectBasedir );
7070 line = line .replace ("$MAVEN_PROJECTBASEDIR" , mavenProjectBasedir );
7171
72- // Strip outer quotes if present (they're just for grouping in jvm.config)
72+ // Strip outer single quotes if present (they're just for grouping in jvm.config)
73+ // But preserve already-doubled quotes (escaped quotes like ""value"")
7374 if (line .startsWith ("\" " ) && line .endsWith ("\" " ) && line .length () > 1 ) {
75+ // Check if it's NOT already escaped (doubled quotes at start/end)
76+ if (!(line .length () >= 4 && line .startsWith ("\" \" " ) && line .endsWith ("\" \" " ))) {
77+ line = line .substring (1 , line .length () - 1 );
78+ }
79+ } else if (line .startsWith ("'" ) && line .endsWith ("'" ) && line .length () > 1 ) {
7480 line = line .substring (1 , line .length () - 1 );
7581 }
7682
77- // Quote the argument to protect special characters for batch script
78- // Escape any quotes by doubling them (batch script convention)
79- line = line .replace ("\" " , "\" \" " );
80-
8183 // Append quoted argument with space separator
8284 if (result .length () > 0 ) {
8385 result .append (' ' );
You can’t perform that action at this time.
0 commit comments