aboutsummaryrefslogtreecommitdiffstats
path: root/src/note.c
diff options
context:
space:
mode:
authorLars Henriksen <LarsHenriksen@get2net.dk>2020-04-07 21:29:26 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2020-04-28 07:32:44 -0400
commite9deb6fff3d56b166ab702828bd1a716c2bf567f (patch)
treead3baec13de756042417321724adff2df8b6f545 /src/note.c
parent214a761564e75abef1740738460288102a571a9b (diff)
downloadcalcurse-e9deb6fff3d56b166ab702828bd1a716c2bf567f.tar.gz
calcurse-e9deb6fff3d56b166ab702828bd1a716c2bf567f.zip
Extend use of note file for iCal import
iCal import to an item note file is extended from DESCRIPTION to LOCATION, COMMENT and STATUS for both events and todos. Addresses GitHub issue #9. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src/note.c')
-rw-r--r--src/note.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/note.c b/src/note.c
index 2160874..92c1ecf 100644
--- a/src/note.c
+++ b/src/note.c
@@ -59,13 +59,9 @@ HTABLE_PROTOTYPE(htp, note_gc_hash)
char *generate_note(const char *str)
{
char *sha1 = mem_malloc(SHA1_DIGESTLEN * 2 + 1);
- char *notepath, *s;
+ char *notepath;
FILE *fp;
- /* Temporary hack */
- asprintf(&s, "%s\n", str);
- str = s;
-
sha1_digest(str, sha1);
asprintf(&notepath, "%s%s", path_notes, sha1);
fp = fopen(notepath, "w");
@@ -74,7 +70,6 @@ char *generate_note(const char *str)
fputs(str, fp);
file_close(fp, __FILE_POS__);
- mem_free(s);
mem_free(notepath);
return sha1;
}