Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbad1067

Browse files
committed
Make TestLib::perl2host more consistent and robust
Sometimes cygpath has been observed to return a path with a trailingslash. That can cause problems, Also, make "cygpath" usageconsistent with "pwd -W" with respect to the use of forward slashes.Backpatch to release 14 where the current code was introduced.
1 parent91f9861 commitbad1067

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎src/test/perl/TestLib.pm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@ except for the case of Perl=msys and host=mingw32. The subject need not
304304
exist, but its parent or grandparent directory must exist unless cygpath is
305305
available.
306306
307+
The returned path uses forward slashes but has no trailing slash.
308+
307309
=cut
308310

309311
subperl2host
@@ -313,10 +315,11 @@ sub perl2host
313315
if ($is_msys2)
314316
{
315317
# get absolute, windows type path
316-
my$path =qx{cygpath -a -w "$subject"};
318+
my$path =qx{cygpath -a -m "$subject"};
317319
if (!$?)
318320
{
319321
chomp$path;
322+
$path =~s!/$!!;
320323
return$pathif$path;
321324
}
322325
# fall through if this didn't work.
@@ -342,6 +345,7 @@ sub perl2host
342345
# this odd way of calling 'pwd -W' is the only way that seems to work.
343346
my$dir =qx{sh -c "pwd -W"};
344347
chomp$dir;
348+
$dir =~s!/$!!;
345349
chdir$here;
346350
return$dir .$leaf;
347351
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp