Skip to content

Commit b80fe85

Browse files
committed
hack/test-port-forwarding.pl: add check for "MSWin32"
Signed-off-by: Norio Nomura <[email protected]> hack/test-port-forwarding.pl: add check for "cygwin", use '\\' instead of '\' Signed-off-by: Norio Nomura <[email protected]> hack/test-port-forwarding.pl: add escape Signed-off-by: Norio Nomura <[email protected]>
1 parent bc83e3d commit b80fe85

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hack/test-port-forwarding.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
# platform independent way to add trailing path separator
4040
my $sockDir = catfile($instDir, "sock", "");
4141
# catfile convert '\' to '/' on Windows, but we want to keep it as '\' since golang on Windows prefers '\'
42-
$sockDir =~ s/\//\\/g if $Config{osname} eq "msys";
42+
$sockDir =~ s/\//\\\\/g if ($Config{osname} eq "cygwin" || $Config{osname} eq "msys" || $Config{osname} eq "MSWin32");
4343

4444
# If $instance is a filename, add our portForwards to it to enable testing
4545
if (-f $instance) {
@@ -127,6 +127,7 @@
127127

128128
my $remote = JoinHostPort($test{guest_ip},$test{guest_port});
129129
my $local = $test{host_socket} eq "" ? JoinHostPort($test{host_ip},$test{host_port}) : $test{host_socket};
130+
$local =~ s/\\/\\\\/g if ($Config{osname} eq "cygwin" || $Config{osname} eq "msys" || $Config{osname} eq "MSWin32");
130131
if ($test{mode} eq "ignore") {
131132
$test{log_msg} = "Not forwarding TCP $remote";
132133
}

0 commit comments

Comments
 (0)