From 94ee32026867f2fde9eb41b212c328e516819cee Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 15 Jun 2000 11:23:22 +0000 Subject: [PATCH] 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 --- deal.II/common/scripts/make_dependencies.pl | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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}); -- 2.39.5