get home env var and evolution path for ics file

This commit is contained in:
2023-08-15 21:17:24 +02:00
parent 6cd264d467
commit 7d66bc7b72
3 changed files with 33 additions and 3 deletions

View File

@ -7,12 +7,22 @@
#include "seek_string_a.h"
#include "remove_whitespace.h"
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <limits.h>
int main() {
const char ICS_PATH[] = "tests/calendar.ics";
//const char ICS_PATH[] = "tests/calendar.ics";
char *ICS_PATH;
char *HOME = getenv("HOME");
if (HOME != NULL) {
ICS_PATH = strcat(HOME, "/.local/share/evolution/calendar/system/calendar.ics");
} else {
printf ("Environment variable HOME is not set.\n");
return 1;
}
char my_line[4096] = "";