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
16
src/io.c
16
src/io.c
@@ -1578,22 +1578,6 @@ unsigned io_get_pid(char *file)
|
||||
return pid;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check whether a file is empty.
|
||||
*/
|
||||
int io_file_is_empty(char *file)
|
||||
{
|
||||
FILE *fp;
|
||||
int ret = -1;
|
||||
|
||||
if (file && (fp = fopen(file, "r"))) {
|
||||
ret = (fgetc(fp) == '\n' && fgetc(fp) == EOF) || feof(fp);
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check whether two files are equal.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user