diff --git a/toolkit/mozapps/installer/Packager.pm b/toolkit/mozapps/installer/Packager.pm index e01e71c4d17..5170cc2d9c3 100644 --- a/toolkit/mozapps/installer/Packager.pm +++ b/toolkit/mozapps/installer/Packager.pm @@ -300,8 +300,15 @@ sub do_copyfile } } + # Translate: */../../*/bin/* + # into: */../../*/* + # (where the *'s are interpreted using shell-notation and + # it matches not only forward slashes but also backslashes.) + # $1 = */../../*/ + # $2 = bin/ + # $3 = * if ($flat) { - $destpath =~ s|bin[/\\]||; + $destpath =~ s|(.*[/\\]\.\.[/\\]\.\.[/\\].+[/\\])(bin[/\\])(.*)|$1$3|; } # create the destination path if it doesn't exist