Author: adsb
Date: 2009-05-11 20:16:38 +0000 (Mon, 11 May 2009)
New Revision: 1880
Modified:
trunk/scripts/chdist.pl
Log:
Use Cwd::cwd() and Cwd::abs_path() rather than badly reimplementing them
Modified: trunk/scripts/chdist.pl
===================================================================
--- trunk/scripts/chdist.pl 2009-05-11 19:51:53 UTC (rev 1879)
+++ trunk/scripts/chdist.pl 2009-05-11 20:16:38 UTC (rev 1880)
@@ -100,6 +100,7 @@
=cut
use Getopt::Long qw(:config require_order);
+use Cwd qw(abs_path cwd);
my $datadir = $ENV{'HOME'} . '/.chdist';
@@ -156,8 +157,8 @@
);
# Fix-up relative paths
-$datadir = $ENV{'PWD'} . "/$datadir" unless $datadir =~ m!^/!;
-$datadir =~ s!/\./!/!g;
+$datadir = cwd() . "/$datadir" unless $datadir =~ m!^/!;
+$datadir = abs_path($datadir);
if ($help) {
print usage(0);
--
To unsubscribe, send mail to [email protected].