summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2010-12-19 15:05:13 +0100
committerDaniel Friesel <derf@finalrewind.org>2010-12-19 15:05:13 +0100
commit4b5f3cc16d56ac7620a001fe5066f17ca8fb7309 (patch)
treead00e00503462f659f69aa1d62a39d88235776dd
parent07abc5ff42ccf85ddef339bf1a12cedd3185a239 (diff)
Use absolute path for dbfile
-rwxr-xr-xbin/hashl6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/hashl b/bin/hashl
index c444edf..2091d3f 100755
--- a/bin/hashl
+++ b/bin/hashl
@@ -17,7 +17,7 @@ use Time::Progress;
my $base = getcwd();
my $rel_paths = 1;
my $read_size = (2 ** 20) * 4; # 4 MiB
-my $db_file = "$base/.hashl.db";
+my $db_file = '.hashl.db';
my $total = 0;
my $cur = 0;
my $timer;
@@ -30,6 +30,10 @@ GetOptions(
'd|database=s' => \$db_file,
);
+if (substr($db_file, 0, 1) ne '/') {
+ $db_file = "${base}/${db_file}";
+}
+
my $action = $ARGV[0];
if (not defined $action) {