Comment about observed issue with MSYS2 paths outside of install tree

This commit is contained in:
Russ Magee 2025-12-19 23:07:03 -08:00
parent c626e988fe
commit d9188faa3c
1 changed files with 6 additions and 0 deletions

View File

@ -626,6 +626,12 @@ func parseNonSwitchArgs(a []string) (user, host, path string, isDest bool, other
// Whether fancyArg is src or dst file depends on flag.Args() index; // Whether fancyArg is src or dst file depends on flag.Args() index;
// fancyArg as last flag.Args() element denotes dstFile // fancyArg as last flag.Args() element denotes dstFile
// fancyArg as not-last flag.Args() element denotes srcFile // fancyArg as not-last flag.Args() element denotes srcFile
/* rlm:2025-12-10 This breaks if srcPath is outside of MSYS2 tree, as srcPath
appears to silently be converted to an absolute winpath eg.,
/c/users/RM/... -> C:/users/RM/...
and the colon (:) in this breaks the logic below.
*/
var fancyUser, fancyHost, fancyPath string var fancyUser, fancyHost, fancyPath string
for i, arg := range a { for i, arg := range a {
if strings.Contains(arg, ":") || strings.Contains(arg, "@") { if strings.Contains(arg, ":") || strings.Contains(arg, "@") {