aboutsummaryrefslogtreecommitdiffstats
path: root/src/note.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2011-09-02 11:52:26 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2011-10-05 12:25:47 +0200
commit6c7edfbb862b1598b74e4413121dfa42e3a79211 (patch)
tree9cb7bb6440680c66aebbe76477a727cd9f879d18 /src/note.c
parentc77d1a573fc9c9d27ccc8c80a5a67245a3cf0e1b (diff)
downloadcalcurse-6c7edfbb862b1598b74e4413121dfa42e3a79211.tar.gz
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/note.c')
-rw-r--r--src/note.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/note.c b/src/note.c
index 36c2c0f..db5c45a 100644
--- a/src/note.c
+++ b/src/note.c
@@ -65,7 +65,7 @@ edit_note (char **note, char *editor)
wins_launch_external (tmppath, editor);
if (io_file_is_empty (tmppath) > 0)
- erase_note (note, ERASE_FORCE_KEEP_NOTE);
+ erase_note (note);
else if ((fp = fopen (tmppath, "r")))
{
sha1_stream (fp, sha1);
@@ -93,18 +93,10 @@ view_note (char *note, char *pager)
/* Erase a note previously attached to an item. */
void
-erase_note (char **note, enum eraseflg flag)
+erase_note (char **note)
{
- char fullname[BUFSIZ];
-
if (*note == NULL)
return;
- if (flag != ERASE_FORCE_KEEP_NOTE)
- {
- (void)snprintf (fullname, BUFSIZ, "%s%s", path_notes, *note);
- if (unlink (fullname) != 0)
- EXIT (_("could not remove note"));
- }
mem_free (*note);
*note = NULL;
}