Do not remove an empty note file after edit session
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
committed by
Lukas Fleischer
parent
e1b5580bdf
commit
e3dd92ef71
@@ -213,8 +213,10 @@ static void ical_export_note(FILE *stream, char *name)
|
||||
int has_desc, has_prop, i;
|
||||
|
||||
asprintf(¬e_file, "%s/%s", path_notes, name);
|
||||
if (!(fp = fopen(note_file, "r")))
|
||||
if (!(fp = fopen(note_file, "r")) || ungetc(getc(fp), fp) == EOF) {
|
||||
fclose(fp);
|
||||
return;
|
||||
}
|
||||
string_init(¬e);
|
||||
while (fgets(lbuf, BUFSIZ, fp))
|
||||
string_catf(¬e, "%s", lbuf);
|
||||
|
||||
Reference in New Issue
Block a user