X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=config.c;h=e77ff2ef871b9887b710a9b604da1b5bc6857701;hb=cc0484b2163383bbf8ed667eaac3f85c66888d2e;hp=1b6fbec1b9aa69c6c450e4d7533c34c31aa8a12a;hpb=62f3fc6838bf0e59bb490b0da229649bf86d847c;p=i3%2Fi3status diff --git a/config.c b/config.c index 1b6fbec..e77ff2e 100644 --- a/config.c +++ b/config.c @@ -109,8 +109,11 @@ int load_configuration(const char *configfile) { OPT("wmii_path") { char *globbed = glob_path(dest_value); - if ((stat(globbed, &stbuf)) == -1) - die("wmii_path contains an invalid path"); + if ((stat(globbed, &stbuf)) == -1) { + fprintf(stderr, "Warning: wmii_path contains an invalid path\n"); + free(globbed); + globbed = strdup(dest_value); + } if (globbed[strlen(globbed)-1] != '/') die("wmii_path is not terminated by /"); wmii_path = globbed; @@ -121,8 +124,6 @@ int load_configuration(const char *configfile) { } OPT("battery_path") { - if ((stat(dest_value, &stbuf)) == -1) - die("battery_path contains an invalid path"); battery_path = strdup(dest_value); } OPT("run_watch") @@ -184,7 +185,7 @@ int load_configuration(const char *configfile) { fclose(handle); if (wmii_path == NULL) - exit(-4); + exit(EXIT_FAILURE); return result; }