summaryrefslogtreecommitdiff
path: root/src/event.c
diff options
context:
space:
mode:
authorFrederic Culot <calcurse@culot.org>2009-07-19 08:19:37 +0000
committerFrederic Culot <calcurse@culot.org>2009-07-19 08:19:37 +0000
commit5dcc213c164a1f25cad4bd76617dc780f5e1dc6f (patch)
tree655127ff74d3a72bacf6bde1a4cb0f7f9733c9fc /src/event.c
parenta4da35c65f77113f998cd60d8a1a10d108138951 (diff)
downloadcalcurse-5dcc213c164a1f25cad4bd76617dc780f5e1dc6f.zip
Make use of erase_note() whenever possible.
Diffstat (limited to 'src/event.c')
-rwxr-xr-xsrc/event.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/event.c b/src/event.c
index 109313f..9b1cd63 100755
--- a/src/event.c
+++ b/src/event.c
@@ -1,4 +1,4 @@
-/* $calcurse: event.c,v 1.14 2009/07/05 20:33:19 culot Exp $ */
+/* $calcurse: event.c,v 1.15 2009/07/19 08:20:00 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -57,16 +57,7 @@ event_free_bkp (erase_flag_e flag)
mem_free (bkp_cut_event.mesg);
bkp_cut_event.mesg = 0;
}
- if (bkp_cut_event.note)
- {
- if (flag == ERASE_FORCE)
- erase_note (&bkp_cut_event.note, ERASE_FORCE);
- else
- {
- mem_free (bkp_cut_event.note);
- bkp_cut_event.note = 0;
- }
- }
+ erase_note (&bkp_cut_event.note, flag);
}
static void
@@ -92,8 +83,7 @@ event_llist_free (void)
o = *i;
*i = o->next;
mem_free (o->mesg);
- if (o->note)
- mem_free (o->note);
+ erase_note (&o->note, ERASE_FORCE_KEEP_NOTE);
mem_free (o);
}
}
@@ -224,8 +214,7 @@ event_delete_bynum (long start, unsigned num, erase_flag_e flag)
case ERASE_CUT:
event_free_bkp (ERASE_FORCE);
event_dup (i, &bkp_cut_event);
- if (i->note)
- mem_free (i->note);
+ erase_note (&i->note, ERASE_FORCE_KEEP_NOTE);
/* FALLTHROUGH */
default:
*iptr = i->next;