diff --git a/src/umonitor.c b/src/umonitor.c index f906166..3f27de8 100644 --- a/src/umonitor.c +++ b/src/umonitor.c @@ -93,6 +93,8 @@ static const struct option long_options[] = { {"force-load", no_argument, &force_load, 1} }; +/* Definition checked against declaration in umonitor.h */ +char* CONFIG_FILE; void umon_print(const char *format, ...) { @@ -127,6 +129,7 @@ void print_state(const char *format, ...) /*! Logic for parsing options here*/ + int main(int argc, char **argv) { home_directory = getenv("HOME"); @@ -147,6 +150,7 @@ int main(int argc, char **argv) print_info(); screen_class_constructor(&screen_o); + CONFIG_FILE = umalloc((strlen(home_directory) + strlen(conf_location))+1); strcpy(CONFIG_FILE, home_directory); diff --git a/src/umonitor.h b/src/umonitor.h index 64db109..f4d13a2 100644 --- a/src/umonitor.h +++ b/src/umonitor.h @@ -1,5 +1,5 @@ // Global variables -char *CONFIG_FILE; /*!< Configuration file path name */ +extern char *CONFIG_FILE; /*!< Configuration file path name */ // Some helper functions void fetch_edid(xcb_randr_output_t * output_p, screen_class * screen_t_p,