From 4b5f3cc16d56ac7620a001fe5066f17ca8fb7309 Mon Sep 17 00:00:00 2001
From: Daniel Friesel <derf@finalrewind.org>
Date: Sun, 19 Dec 2010 15:05:13 +0100
Subject: Use absolute path for dbfile

---
 bin/hashl | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'bin')

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) {
-- 
cgit v1.2.3