arturobernalg opened a new pull request, #471:
URL: https://github.com/apache/maven-wrapper/pull/471

   Fixes #261.
   
   MAVEN_PROJECTBASEDIR ends up as e.g. "Z:\" (trailing backslash) when the 
project is at the root of a drive, such as after "subst Z: <dir>". That 
backslash lands right before the closing quote of the 
-Dmaven.multiModuleProjectDirectory argument, i.e. ...PROJECTBASEDIR=Z:\" -- 
which the next process' C runtime command-line parser reads as an escaped, 
literal quote rather than the argument terminator (an odd run of backslashes 
before a quote escapes it), corrupting everything after it on the command line 
and making java dump its usage text instead of launching Maven.
   
   Computes a separate MAVEN_PROJECTBASEDIR_ARG for that one argument, doubling 
a trailing backslash if present. A doubled trailing backslash is the same path 
on Windows, but an even run of backslashes before the closing quote is 
interpreted as literal backslashes rather than an escape, so the quote 
correctly terminates the argument.
   
   I don't have a Windows box to run this on, so I verified it against the 
documented Microsoft C runtime command-line parsing algorithm by implementing 
it and feeding it both the original and the fixed argument strings: the 
original merges everything after it into one corrupted argument (matching the 
reported symptom), the fix produces two clean, separate ones with the path 
value unchanged. Full module build and existing test suite pass locally.
   
   To make clear that you license your contribution under
   the Apache License Version 2.0, January 2004
   check one of the following:
   
   - [x] I hereby declare this contribution to be licensed under the Apache 
License Version 2.0, January 2004
   - [ ] I hereby declare that I have filed an Apache Individual Contributor 
License Agreement.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to