diff options
Diffstat (limited to 'booki.c')
| -rw-r--r-- | booki.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -7,7 +7,6 @@ #include <sys/wait.h> #include <unistd.h> -#define BOOKI_FILE_REL ".local/share/booki/books.toml" #define EDIT_FILE "tmp.toml" #define MAX_SEARCH_OPTS 5 @@ -555,9 +554,12 @@ void help(bool err) { int main(int argc, char* argv[]) { - char* home = getenv("HOME"); - char booki_file[strlen(home) + strlen(BOOKI_FILE_REL) + 1]; - sprintf(booki_file, "%s/%s", home, BOOKI_FILE_REL); + char* booki_file = getenv("BOOKI_FILE"); + if (!booki_file) { + printf("expecting BOOKI_FILE variable\n"); + return 1; + } + char** remaining = NULL; if (argc == 1) { |
