diff options
| author | El-BG-1970 <elouangros@hotmail.com> | 2021-10-22 15:10:56 +0200 |
|---|---|---|
| committer | El-BG-1970 <elouangros@hotmail.com> | 2021-11-01 22:02:36 +0100 |
| commit | bcdfd5d893818bba15f7f616e5f255e2fafed7ed (patch) | |
| tree | 574e306555d5d0d10b83a06aba3572e87045fc6a /agenda_entry.c | |
| parent | 5e4972c3fbb5b93df4ac4ed65a78af45086432dc (diff) | |
| download | org-to-conky-bcdfd5d893818bba15f7f616e5f255e2fafed7ed.tar.gz | |
fixed issue where agenda entries could not have colons
Diffstat (limited to 'agenda_entry.c')
| -rw-r--r-- | agenda_entry.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/agenda_entry.c b/agenda_entry.c index fa933c6..91a23b9 100644 --- a/agenda_entry.c +++ b/agenda_entry.c @@ -1,3 +1,4 @@ +#include "utils.h" #include "agenda_entry.h" char *next_word(char *str) { return strstr(str, " ")+1; } @@ -24,7 +25,7 @@ entry read_agenda_entry(char *agenda) { //find out if there is a tag, and extract it lookahead = strstr(cursor, ":\n"); if (lookahead && (lookahead < nextentry)) { - tmp = strstr(cursor, ":"); + tmp = rstrchr(cursor, lookahead-1, ':'); agenda_entry.tag = (char *)malloc(lookahead - tmp); strncpy(agenda_entry.tag, tmp+1, lookahead - tmp - 1); agenda_entry.tag[lookahead - tmp - 1] = '\0'; // here we're actually modifying lookahead-tmp cause the array is zero indexed |
