From bdd7cfe24e80a5a9fa0064da8445989cf585ac68 Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Fri, 1 Sep 2006 15:26:48 +0000 Subject: [PATCH] Change the searchpath separator to glib macro so that on Windows, ';' is used. Also clean up more path creation functions. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14777 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/backend/file/gnc-backend-file.c | 3 +-- src/gnc-module/gnc-module.c | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/backend/file/gnc-backend-file.c b/src/backend/file/gnc-backend-file.c index df8d504900..8431423c88 100644 --- a/src/backend/file/gnc-backend-file.c +++ b/src/backend/file/gnc-backend-file.c @@ -667,8 +667,7 @@ gnc_file_be_remove_old_files(FileBackend *be) if (gnc_file_be_select_files (dent) == 0) continue; - /* G_DIR_SEPARATOR_S is "/" on unix and "\\" on windows. */ - name = g_strconcat(be->dirname, G_DIR_SEPARATOR_S, dent->d_name, NULL); + name = g_build_filename(be->dirname, dent->d_name, (char*)NULL); len = strlen(name) - 4; /* Is this file associated with the current data file */ diff --git a/src/gnc-module/gnc-module.c b/src/gnc-module/gnc-module.c index 0c0eba9faf..ed56b97730 100644 --- a/src/gnc-module/gnc-module.c +++ b/src/gnc-module/gnc-module.c @@ -87,7 +87,8 @@ gnc_module_system_search_dirs(void) break; #endif - case ':': + /* This is ':' on UNIX machines and ';' under Windows. */ + case G_SEARCHPATH_SEPARATOR: if(!escchar) { list = g_list_append(list, token->str); @@ -228,9 +229,8 @@ gnc_module_system_refresh(void) { /* get the full path name, then dlopen the library and see * if it has the appropriate symbols to be a gnc_module */ - fullpath = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", (char *)(current->data), - dent->d_name); - /* G_DIR_SEPARATOR_S is "/" on unix and "\\" on windows. */ + fullpath = g_build_filename((const gchar *)(current->data), + dent->d_name, (char*)NULL); info = gnc_module_get_info(fullpath); if(info)