gnucash maint: Bug 797175 - Opening a file from a gvfs mount point fails

Robert Fewell bobit at code.gnucash.org
Fri Apr 19 11:01:53 EDT 2019


Updated	 via  https://github.com/Gnucash/gnucash/commit/20e2b6b5 (commit)
	from  https://github.com/Gnucash/gnucash/commit/e3e11afc (commit)



commit 20e2b6b5de513d4fa9362d51524f8cddb523f607
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Fri Apr 19 15:51:29 2019 +0100

    Bug 797175 - Opening a file from a gvfs mount point fails
    
    When testing for a MS Windows path which has a ":", a gvfs path with the
    format '/run/user/1000/gvfs/smb-share:server=192.168.1.11,share=public/
    test-xml-file.gnucash' is recognised as a Windows path. To avoid this
    expand the test to ":/" and also ":\"

diff --git a/libgnucash/engine/gnc-uri-utils.c b/libgnucash/engine/gnc-uri-utils.c
old mode 100644
new mode 100755
index 0158820e3..40ec6fef1
--- a/libgnucash/engine/gnc-uri-utils.c
+++ b/libgnucash/engine/gnc-uri-utils.c
@@ -177,8 +177,10 @@ void gnc_uri_get_components (const gchar *uri,
     if ( gnc_uri_is_file_scheme ( *scheme ) )
     {
         /* a true file uri on windows can start file:///N:/
-           so we come here with /N:/                       */
-        if (g_str_has_prefix (splituri[1], "/") && g_strstr_len (splituri[1], -1,  ":") != NULL)
+           so we come here with /N:/, it could also be /N:\
+        */
+        if (g_str_has_prefix (splituri[1], "/") &&
+           ((g_strstr_len (splituri[1], -1,  ":/") != NULL) || (g_strstr_len (splituri[1], -1,  ":\\") != NULL)))
         {
             gchar *ptr = splituri[1];
             *path = gnc_resolve_file_path ( ptr + 1 );



Summary of changes:
 libgnucash/engine/gnc-uri-utils.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
 mode change 100644 => 100755 libgnucash/engine/gnc-uri-utils.c



More information about the gnucash-changes mailing list