summaryrefslogtreecommitdiffstats
path: root/bin/syncqt
diff options
context:
space:
mode:
authorJames Perrett <james.perrett@tandberg.com>2010-03-15 14:54:31 (GMT)
committerZeno Albisser <zeno.albisser@nokia.com>2010-05-03 15:12:28 (GMT)
commit388705d3616c3edd0bb1c7bfef2f093a446ff13a (patch)
tree4d13900a06e03348139682ce83fce9f04534541d /bin/syncqt
parent9c419f945f1644e1bb66f4b5216a3d3adddb75b9 (diff)
downloadQt-388705d3616c3edd0bb1c7bfef2f093a446ff13a.zip
Qt-388705d3616c3edd0bb1c7bfef2f093a446ff13a.tar.gz
Qt-388705d3616c3edd0bb1c7bfef2f093a446ff13a.tar.bz2
Bug fix: Allow $QTDIR to contain regex metacharacters
Quote $QTDIR (and variables based on it) when they are used in regex patterns - this allows $QTDIR to contain valid pathname characters that are also regex metacharacters, such as '.' and '+'. Merge-Request: 506 Reviewed-by: Zeno Albisser
Diffstat (limited to 'bin/syncqt')
-rwxr-xr-xbin/syncqt17
1 files changed, 8 insertions, 9 deletions
diff --git a/bin/syncqt b/bin/syncqt
index e36eeb6..71b71db 100755
--- a/bin/syncqt
+++ b/bin/syncqt
@@ -75,6 +75,7 @@ my @modules_to_sync ;
$force_relative = 1 if ( -d "/System/Library/Frameworks" );
my $out_basedir = $basedir;
$out_basedir =~ s=\\=/=g;
+my $quoted_basedir = "\Q$basedir";
# functions ----------------------------------------------------------
@@ -349,11 +350,9 @@ sub syncHeader {
######################################################################
sub fixPaths {
my ($file, $dir) = @_;
- $dir =~ s=^$basedir/=$out_basedir/= if(!($basedir eq $out_basedir));
+ $dir =~ s=^$quoted_basedir/=$out_basedir/= if(!($basedir eq $out_basedir));
$file =~ s=\\=/=g;
- $file =~ s/\+/\\+/g;
$dir =~ s=\\=/=g;
- $dir =~ s/\+/\\+/g;
#setup
my $ret = $file;
@@ -377,7 +376,7 @@ sub fixPaths {
my $slash = index($file_dir, "/", $i);
last if($slash == -1);
my $tmp = substr($file_dir, 0, $slash);
- last unless($dir =~ m,^$tmp/,);
+ last unless($dir =~ m,^\Q$tmp\E/,);
$match_dir = $tmp;
$i = $slash;
}
@@ -388,7 +387,7 @@ sub fixPaths {
for(my $i = 0; $i < $count; $i++) {
$dots .= "../";
}
- $ret =~ s,^$match_dir,$dots,;
+ $ret =~ s,^\Q$match_dir\E,$dots,;
}
$ret =~ s,/+,/,g;
return $ret;
@@ -504,13 +503,13 @@ sub symlinkFile
if ($isunix) {
print "symlink created for $file " unless $quiet;
- if ( $force_relative && ($ifile =~ /^$basedir/)) {
+ if ( $force_relative && ($ifile =~ /^$quoted_basedir/)) {
my $t = getcwd();
my $c = -1;
my $p = "../";
- $t =~ s-^$basedir/--;
+ $t =~ s-^$quoted_basedir/--;
$p .= "../" while( ($c = index( $t, "/", $c + 1)) != -1 );
- $file =~ s-^$basedir/-$p-;
+ $file =~ s-^$quoted_basedir/-$p-;
print " ($file)\n" unless $quiet;
}
print "\n" unless $quiet;
@@ -830,7 +829,7 @@ foreach (@modules_to_sync) {
if ($public_header) {
@headers = ( "$out_basedir/include/$lib/$header" );
push @headers, "$out_basedir/include/Qt/$header"
- if ("$lib" ne "phonon" && "$subdir" =~ /^$basedir\/src/);
+ if ("$lib" ne "phonon" && "$subdir" =~ /^$quoted_basedir\/src/);
foreach(@classes) {
my $header_base = basename($header);