diary

Text-based journaling program
git clone https://git.in0rdr.ch/diary.git
Log | Files | Refs | README | LICENSE

commit 6272882e0dbfc4e20e72855fd7ac842bddf7ef1d
parent 3fc500b373489fe0851b7f23be0bc75f7a60e3a7
Author: Andreas Gruhler <agruhl@gmx.ch>
Date:   Sat, 25 Dec 2021 17:10:05 +0100

feat(import): skip entries

Diffstat:
Msrc/import.c | 11+++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/import.c b/src/import.c @@ -19,7 +19,6 @@ void ics_import(const char* ics_input, WINDOW* header, WINDOW* cal, WINDOW* asid fclose(pfile); ics[ics_bytes] = '\0'; - // fprintf(stderr, "Import ICS file: %s\n", ics); int conf_ch = 0; char dstr[16]; @@ -44,8 +43,6 @@ void ics_import(const char* ics_input, WINDOW* header, WINDOW* cal, WINDOW* asid break; } - i += search_pos; - // parse date strptime(vevent_date, "%Y%m%d", &date); strftime(dstr, sizeof dstr, CONFIG.fmt, &date); @@ -69,7 +66,7 @@ void ics_import(const char* ics_input, WINDOW* header, WINDOW* cal, WINDOW* asid wclear(header); // ask for confirmation - mvwprintw(header, 0, 0, "Import entry '%s' and overwrite local file? [(Y)es/(a)ll/(n)o/(c)ancel] ", dstr); + mvwprintw(header, 0, 0, "Import entry '%s' and overwrite local file? [(y)es/(a)ll/(s)kip/(c)ancel] ", dstr); conf_ch = wgetch(header); } @@ -109,8 +106,10 @@ void ics_import(const char* ics_input, WINDOW* header, WINDOW* cal, WINDOW* asid } } pthread_cancel(progress_tid); - } else if (conf_ch == 'n') { - continue; + + i += search_pos; + } else if (conf_ch == 's') { + i += search_pos; } free(vevent);