FIXED: the binary driver (NOTEDB::binary) encounters now if a note

entry is bigger then MaxNoteByte. It prints the overlapping
                part to STDERR, and a warning message and finally saves
                the complete, unchanged note entry to an external text file.
This commit is contained in:
TLINDEN
2012-02-10 20:30:10 +01:00
parent c15c8ba731
commit 23c301be2a
8 changed files with 404 additions and 301 deletions

View File

@@ -128,7 +128,7 @@ $TIME_COLOR = "blue";
$TOPIC_COLOR = "bold";
$TOPIC = 1;
$TopicSep = '/';
$version = "1.2.5";
$version = "1.2.6";
if ($TOPIC) {
$CurDepth = 1; # the current depth inside the topic "directory" structure...
}
@@ -797,7 +797,7 @@ sub del {
############################### EDIT ##################################
sub edit {
my($keeptime, $date, $editor, $TEMP, $note, $t, $num, $match);
my($keeptime, $date, $editor, $TEMP, $note, $t, $num, $match, $backup);
# edit a note
$date = &getdate;
($note, $keeptime) = $db->get_single($number);
@@ -816,6 +816,8 @@ sub edit {
select STDOUT;
$editor = &find_editor;
$backup = $note;
if ($editor) {
system ($editor, $TEMP) and die "Could not execute $editor: $!\n";
}
@@ -834,16 +836,21 @@ sub edit {
unlink $TEMP || die $!;
if ($KEEP_TIMESTAMP eq "YES") {
$t = $keeptime;
if ($note ne $backup) {
if ($KEEP_TIMESTAMP eq "YES") {
$t = $keeptime;
}
else {
$t = $date;
}
# we got it, now save to db
$db->set_edit($number, $note, $t);
print "note number $number has been changed.\n";
}
else {
$t = $date;
print "note number $number has not changed, no save done.\n";
}
# we got it, now save to db
$db->set_edit($number, $note, $t);
print "note number $number has been changed.\n";
}