From 8e2d4025fc02e07866869a33ccc686f87389cb36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Fri, 8 Feb 2019 21:13:08 +0100 Subject: V{calendar,event} merged into vcomponent, making it symmetic. --- calendar.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'calendar.c') diff --git a/calendar.c b/calendar.c index 8fc4199b..477de492 100644 --- a/calendar.c +++ b/calendar.c @@ -17,6 +17,9 @@ /* * Returns 0 if file has no extersion + * + * TODO this looks from the first point, it should look from the last + * point. */ int get_extension(const char* filename, char* ext, ssize_t max_len) { int ext_idx = -1; @@ -41,7 +44,7 @@ int get_extension(const char* filename, char* ext, ssize_t max_len) { * TODO merge the code for files and dirs. */ -int parse_dir(vcalendar* cal, char* path) { +int parse_dir(vcomponent* cal, char* path) { DIR* dir = opendir(path); struct dirent* d; while ((d = readdir(dir)) != NULL) { @@ -81,7 +84,7 @@ int parse_dir(vcalendar* cal, char* path) { return 0; } -int read_vcalendar(vcalendar* cal, char* path) { +int read_vcalendar(vcomponent* cal, char* path) { struct stat statbuf; if (stat (path, &statbuf) != 0) { @@ -101,7 +104,7 @@ int read_vcalendar(vcalendar* cal, char* path) { char ext[10]; int has_ext = get_extension(path, ext, 9); if (! has_ext || strcmp(ext, "ics") != 0) { - fprintf(stderr, "File doesn't have .ics extension.\n"); + fprintf(stderr, "File doesn't have .ics extension. [%s]\n", ext); exit(1); } -- cgit v1.2.3