diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-09-02 11:52:26 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-10-05 12:25:47 +0200 |
commit | 6c7edfbb862b1598b74e4413121dfa42e3a79211 (patch) | |
tree | 9cb7bb6440680c66aebbe76477a727cd9f879d18 /src/apoint.c | |
parent | c77d1a573fc9c9d27ccc8c80a5a67245a3cf0e1b (diff) | |
download | calcurse-6c7edfbb862b1598b74e4413121dfa42e3a79211.zip |
Do not unlink() note files on note removal
Now that we use hash-based note file names, note files should never be
unlinked as a note file might be shared.
Also, remove the ERASE_FORCE_KEEP_NOTE flag that no longer makes any
sense.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/apoint.c')
-rw-r--r-- | src/apoint.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/apoint.c b/src/apoint.c index 6fd9e64..a49b156 100644 --- a/src/apoint.c +++ b/src/apoint.c @@ -46,21 +46,21 @@ static struct apoint bkp_cut_apoint; static int hilt; void -apoint_free_bkp (enum eraseflg flag) +apoint_free_bkp (void) { if (bkp_cut_apoint.mesg) { mem_free (bkp_cut_apoint.mesg); bkp_cut_apoint.mesg = 0; } - erase_note (&bkp_cut_apoint.note, flag); + erase_note (&bkp_cut_apoint.note); } static void apoint_free (struct apoint *apt) { mem_free (apt->mesg); - erase_note (&apt->note, ERASE_FORCE_KEEP_NOTE); + erase_note (&apt->note); mem_free (apt); } @@ -500,20 +500,18 @@ apoint_delete_bynum (long start, unsigned num, enum eraseflg flag) switch (flag) { case ERASE_FORCE_ONLY_NOTE: - erase_note (&apt->note, flag); + erase_note (&apt->note); break; case ERASE_CUT: - apoint_free_bkp (ERASE_FORCE); + apoint_free_bkp (); apoint_dup (apt, &bkp_cut_apoint); - erase_note (&apt->note, ERASE_FORCE_KEEP_NOTE); + erase_note (&apt->note); /* FALLTHROUGH */ default: if (notify_bar ()) need_check_notify = notify_same_item (apt->start); LLIST_TS_REMOVE (&alist_p, i); mem_free (apt->mesg); - if (flag != ERASE_FORCE_KEEP_NOTE && flag != ERASE_CUT) - erase_note (&apt->note, flag); mem_free (apt); if (need_check_notify) notify_check_next_app (0); @@ -733,5 +731,5 @@ apoint_paste_item (void) if (notify_bar ()) notify_check_added (bkp_cut_apoint.mesg, bkp_start, bkp_cut_apoint.state); - apoint_free_bkp (ERASE_FORCE_KEEP_NOTE); + apoint_free_bkp (); } |