From 5bb341a58b5fc0a4b593a30370a14b4a3df486e2 Mon Sep 17 00:00:00 2001 From: elliott_c Date: Thu, 16 Oct 2003 14:02:49 +0000 Subject: ChangeLogTag: Thu Oct 16 09:02:24 2003 Chad Elliott --- bin/DependencyGenerator/DependencyGenerator.pm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/DependencyGenerator/DependencyGenerator.pm b/bin/DependencyGenerator/DependencyGenerator.pm index f84b31ca40e..91053a8a207 100644 --- a/bin/DependencyGenerator/DependencyGenerator.pm +++ b/bin/DependencyGenerator/DependencyGenerator.pm @@ -31,12 +31,26 @@ sub new { $options, $ipaths), 'replace' => $replace, 'dwrite' => DependencyWriterFactory::create($type), - 'cwd' => Cwd::getcwd() . '/', + 'cwd' => undef, }, $class; + + ## Set the current working directory, but + ## escape regular expression special characters + $self->{'cwd'} = $self->escape_regex_special(Cwd::getcwd()) . '/'; + return $self; } +sub escape_regex_special { + my($self) = shift; + my($name) = shift; + + $name =~ s/([\+\-\\\$\[\]\(\)\.])/\\$1/g; + return $name; +} + + sub process { my($self) = shift; my($file) = shift; -- cgit v1.2.1