r14785 - gnucash/trunk/lib/libqof/qof - For windows, fall back to the file backend if a colon was in the URL name.

Derek Atkins warlord at MIT.EDU
Wed Sep 13 12:01:49 EDT 2006


Christian Stimming <cstim at cvs.gnucash.org> writes:

> Log:
> For windows, fall back to the file backend if a colon was in the URL name.

I'm wondering if we should only fallback if the colon is in position
1?  I think it's only valid to have "C:"  (where "C" can be "[A-Z]"),
but I dont think the colon is valid in any other location.

> Modified: gnucash/trunk/lib/libqof/qof/qofsession.c
> ===================================================================
> --- gnucash/trunk/lib/libqof/qof/qofsession.c	2006-09-02 15:44:45 UTC (rev 14784)
> +++ gnucash/trunk/lib/libqof/qof/qofsession.c	2006-09-02 19:18:27 UTC (rev 14785)
> @@ -1006,6 +1006,15 @@
>      *p = '\0';
>      qof_session_load_backend(session, access_method);
>      g_free (access_method);
> +#if G_OS_WIN32
> +    if (NULL == session->backend)
> +    {
> +      /* On windows, a colon can be part of a normal filename. So if
> +	 no backend was found (which means the part before the colon
> +	 wasn't an access method), fall back to the file backend. */
> +      qof_session_load_backend(session, "file"); 
> +    }
> +#endif

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-devel mailing list