mirror of
https://codeberg.org/scip/note.git
synced 2025-12-17 04:31:02 +01:00
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:
25
bin/note
25
bin/note
@@ -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";
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user