diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm index bda08ac1ae..c9925bfac0 100644 --- a/src/tools/msvc/Install.pm +++ b/src/tools/msvc/Install.pm @@ -424,15 +424,16 @@ sub CopyIncludeFiles my $D; opendir($D, 'src/include') || croak "Could not opendir on src/include!\n"; - while (my $d = readdir($D)) + # some xcopy progs don't like mixed slash style paths + (my $ctarget = $target) =~ s!/!\\!g; + while (my $d = readdir($D)) { next if ($d =~ /^\./); next if ($d eq 'CVS'); - next unless (-d 'src/include/' . $d); + next unless (-d "src/include/$d"); - EnsureDirectories($target . '/include/server', $d); - system( - "xcopy /s /i /q /r /y src\\include\\$d\\*.h \"$target\\include\\server\\$d\\\"") + EnsureDirectories("$target/include/server/$d"); + system(qq{xcopy /s /i /q /r /y src\\include\\$d\\*.h "$ctarget\\include\\server\\$d\\"}) && croak("Failed to copy include directory $d\n"); } closedir($D);