summaryrefslogtreecommitdiffstats
path: root/source/rofi.c
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-06-20 18:10:18 +0200
committerDave Davenport <qball@gmpclient.org>2017-06-20 18:10:18 +0200
commitda008484168b56b92646e7b5ddd676a1d17680d2 (patch)
tree65f53f602acad1faf6c53277536736191df6c576 /source/rofi.c
parent8375fbb5136c4aca009afa005d129ba580bf2cdc (diff)
Do better error reporting on configuration entries in rasi format.
Diffstat (limited to 'source/rofi.c')
-rw-r--r--source/rofi.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/source/rofi.c b/source/rofi.c
index 76d1ccc8..39013f09 100644
--- a/source/rofi.c
+++ b/source/rofi.c
@@ -82,7 +82,7 @@ void rofi_add_error_message ( GString *str )
}
/** Path to the configuration file */
-G_MODULE_EXPORT char *config_path = NULL;
+G_MODULE_EXPORT char *config_path = NULL;
G_MODULE_EXPORT char *config_path_new = NULL;
/** Array holding all activated modi. */
Mode **modi = NULL;
@@ -324,7 +324,8 @@ static void help ( G_GNUC_UNUSED int argc, char **argv )
if ( find_arg ( "-no-config" ) < 0 ) {
if ( config_path_new ) {
printf ( " Configuration file: %s%s%s\n", is_term ? color_bold : "", config_path_new, is_term ? color_reset : "" );
- } else {
+ }
+ else {
printf ( " Configuration file: %s%s%s\n", is_term ? color_bold : "", config_path, is_term ? color_reset : "" );
}
}
@@ -771,8 +772,8 @@ int main ( int argc, char *argv[] )
if ( find_arg ( "-config" ) < 0 ) {
const char *cpath = g_get_user_config_dir ();
if ( cpath ) {
- config_path = g_build_filename ( cpath, "rofi", "config", NULL );
- config_path_new = g_strconcat ( config_path, ".rasi" , NULL );
+ config_path = g_build_filename ( cpath, "rofi", "config", NULL );
+ config_path_new = g_strconcat ( config_path, ".rasi", NULL );
}
}
else {
@@ -780,7 +781,8 @@ int main ( int argc, char *argv[] )
find_arg_str ( "-config", &c );
if ( g_str_has_suffix ( c, ".rasi" ) ) {
config_path_new = rofi_expand_path ( c );
- } else {
+ }
+ else {
config_path = rofi_expand_path ( c );
}
}
@@ -822,12 +824,13 @@ int main ( int argc, char *argv[] )
g_free ( etc );
// Load in config from X resources.
config_parse_xresource_options ( xcb );
- if ( config_path_new && g_file_test ( config_path_new, G_FILE_TEST_IS_REGULAR) ) {
- if ( rofi_theme_parse_file ( config_path_new) ) {
+ if ( config_path_new && g_file_test ( config_path_new, G_FILE_TEST_IS_REGULAR ) ) {
+ if ( rofi_theme_parse_file ( config_path_new ) ) {
rofi_theme_free ( rofi_theme );
rofi_theme = NULL;
}
- } else {
+ }
+ else {
config_parse_xresource_options_file ( config_path );
}
}