diff options
Diffstat (limited to 'lib/Automake/FileUtils.pm')
-rw-r--r-- | lib/Automake/FileUtils.pm | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/lib/Automake/FileUtils.pm b/lib/Automake/FileUtils.pm index 17d8a4990..fc2347b7c 100644 --- a/lib/Automake/FileUtils.pm +++ b/lib/Automake/FileUtils.pm @@ -45,40 +45,13 @@ use Automake::ChannelDefs; use vars qw (@ISA @EXPORT); @ISA = qw (Exporter); -@EXPORT = qw (&open_quote &contents +@EXPORT = qw (&contents &find_file &mtime &update_file &up_to_date_p &xsystem &xsystem_hint &xqx &dir_has_case_matching_file &reset_dir_cache &set_dir_cache_file); - -=item C<open_quote ($file_name)> - -Quote C<$file_name> for open. - -=cut - -# $FILE_NAME -# open_quote ($FILE_NAME) -# ----------------------- -# If the string $S is a well-behaved file name, simply return it. -# If it starts with white space, prepend './', if it ends with -# white space, add '\0'. Return the new string. -sub open_quote($) -{ - my ($s) = @_; - if ($s =~ m/^\s/) - { - $s = "./$s"; - } - if ($s =~ m/\s$/) - { - $s = "$s\0"; - } - return $s; -} - =item C<find_file ($file_name, @include)> Return the first path for a C<$file_name> in the C<include>s. @@ -168,7 +141,7 @@ sub update_file ($$;$) if ($to eq '-') { - my $in = new IO::File ("< " . open_quote ($from)); + my $in = new IO::File $from, "<"; my $out = new IO::File (">-"); while ($_ = $in->getline) { @@ -360,7 +333,7 @@ sub contents ($) my ($file) = @_; verb "reading $file"; local $/; # Turn on slurp-mode. - my $f = new Automake::XFile "< " . open_quote ($file); + my $f = new Automake::XFile $file, "<"; my $contents = $f->getline; $f->close; return $contents; |