summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2018-11-06 17:57:41 -0500
committerJason Woodward2018-11-06 17:57:41 -0500
commit92dfc8a9051c3256f9aeb52149a47eee2423b618 (patch)
tree2e610774d500c8085f0b81db159bdbe13fab0d5d
parentfa17af5cbc5a9f83c6a8c722c4507598c27813cc (diff)
downloadgslapt-92dfc8a9051c3256f9aeb52149a47eee2423b618.tar.gz
initialize updated working directory on preference change
-rw-r--r--src/callbacks.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/callbacks.c b/src/callbacks.c
index cda2061..9ca7c8d 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -2494,14 +2494,9 @@ void preferences_on_ok_clicked (GtkWidget *w, gpointer *user_data)
GtkTreeIter iter;
gboolean valid;
- strncpy(
- global_config->working_dir,
- working_dir,
- strlen(working_dir)
- );
- global_config->working_dir[
- strlen(working_dir)
- ] = '\0';
+ strcpy(global_config->working_dir, working_dir);
+ slapt_working_dir_init(global_config);
+ chdir(global_config->working_dir);
slapt_free_list(global_config->exclude_list);
slapt_free_source_list(global_config->sources);