]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix a bug where the script produced some strange results when we had a ++ in the...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 15 Jun 2000 12:02:55 +0000 (12:02 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 15 Jun 2000 12:02:55 +0000 (12:02 +0000)
git-svn-id: https://svn.dealii.org/branches/Branch-3-0@3025 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/common/scripts/make_dependencies.pl

index f657e9c5dbc7cb874563bb420e8426a7f4e31d17..91143e02c609e0fdee2cffa5b0170bc79ef5a928 100644 (file)
@@ -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});

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.