mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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 ":\"
This commit is contained in:
6
libgnucash/engine/gnc-uri-utils.c
Normal file → Executable file
6
libgnucash/engine/gnc-uri-utils.c
Normal file → Executable file
@@ -177,8 +177,10 @@ void gnc_uri_get_components (const gchar *uri,
|
|||||||
if ( gnc_uri_is_file_scheme ( *scheme ) )
|
if ( gnc_uri_is_file_scheme ( *scheme ) )
|
||||||
{
|
{
|
||||||
/* a true file uri on windows can start file:///N:/
|
/* a true file uri on windows can start file:///N:/
|
||||||
so we come here with /N:/ */
|
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)
|
*/
|
||||||
|
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];
|
gchar *ptr = splituri[1];
|
||||||
*path = gnc_resolve_file_path ( ptr + 1 );
|
*path = gnc_resolve_file_path ( ptr + 1 );
|
||||||
|
|||||||
Reference in New Issue
Block a user