From: wolf Date: Thu, 15 Jun 2000 11:23:22 +0000 (+0000) Subject: Fix a bug where the script produced some strange results when we had a ++ in the... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70a4627b44f5c03fb4ff8bdac55e117bc4d85ab8;p=dealii-svn.git Fix a bug where the script produced some strange results when we had a ++ in the path. git-svn-id: https://svn.dealii.org/trunk@3022 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/common/scripts/make_dependencies.pl b/deal.II/common/scripts/make_dependencies.pl index f657e9c5db..91143e02c6 100644 --- a/deal.II/common/scripts/make_dependencies.pl +++ b/deal.II/common/scripts/make_dependencies.pl @@ -95,7 +95,23 @@ foreach $file (@input_files) { sub complete { local ($file, $include) = ($_[0], $_[1]); foreach $second_include (split(' ',$include_files{$include})) { - if (! ($include_files{$file} =~ $second_include)) { + # check whether $second_include is in the list of filenames + # $include_file{$file}. in order to avoid that characters + # in the filename and/or path of $second_include are + # interpreted as special characters in the regexp matches, + # we have to escape all such characters (well, there + # may be more, but I hope that no one uses them in filenames). + my $pattern = $second_include; + $pattern =~ s/\+/\\+/g; + $pattern =~ s/\*/\\*/g; + $pattern =~ s/\?/\\?/g; + $pattern =~ s/\(/\\(/g; + $pattern =~ s/\)/\\)/g; + $pattern =~ s/\[/\\[/g; + $pattern =~ s/\]/\\]/g; + $pattern =~ s/\{/\\{/g; + $pattern =~ s/\}/\\}/g; + if (! ($include_file{$file} =~ $pattern)) { #second_include not yet in list of included files $include_files{$file} = join(' ', $second_include, $include_files{$file});