From 609a829a6402430de0397a320c389e8c16f900e9 Mon Sep 17 00:00:00 2001 From: "git@daemon.de" Date: Wed, 19 Jun 2013 11:52:26 +0200 Subject: [PATCH] fixed checking of encrypted notes when encryption is turned off --- bin/note | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/note b/bin/note index f8150f7..305e902 100755 --- a/bin/note +++ b/bin/note @@ -144,7 +144,7 @@ $CONF = File::Spec->catfile($ENV{HOME}, ".noterc"); $USER = getlogin || getpwuid($<); chomp $USER; $TOPIC = 1; -$version = "1.3.15"; +$version = "1.3.16"; $CurDepth = 1; # the current depth inside the topic "directory" structure... $maxlen = "auto"; $timelen = 22; @@ -467,9 +467,10 @@ else { $db->no_crypt; # does: NOTEDB::crypt_supported = 0; - my ($cnote, $cdate) = $db->get_single(1); - if ($cdate ne "") { - if ($cdate !~ /^\d+\.\d+?/) { + my %all = $db->get_all(); + if(scalar keys %all > 0) { + my $id = (keys %all)[0]; + if($all{$id}->{date} !~ /^\d+\.\d+?/) { print "notedb seems to be encrypted!\n"; exit(1); }