get home env var and evolution path for ics file
This commit is contained in:
12
src/main.c
12
src/main.c
@ -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] = "";
|
||||
|
||||
|
Reference in New Issue
Block a user