Comment 14 for bug 1022719

Revision history for this message
Patrick Monnerat (patrick-monnerat) wrote :

> With the patch from comment #1 the path is no longer considered relative and the URI passed to createNewDoc is correctly formated. But on Windows, it still fails.
This is the reason for my "character size" statement in comment #5: Before fix of bug #695120, the Inkscape::Extension::open() procedure used the filename pointer as an opaque pointer, although declared as gchar *. This is not the case anymore after fix for 695120 and the current patch.
As a consequence, code prior bug #695120 fix may have worked for non 8-bit characters in filename, providing the procedures called by Inkscape::Extension::open() (directly or indirectly) that really deal with the filename properly take care of the effective filename character type. I'can't check that: they are to many nested procedures called and as I said, I have no W$ to check it.
If this is the problem, this could explain the current behavior: since Inkscape::Extension::open() only deals with 8-bit characters (gchar), any non-null 16-bit LE character string is understood as a single 8-bit character string, thus the URI form detection cannot be successful.
The first thing I would check (if I could!) would be the real form of the filename upon procedure entry, to confirm or infirm this is the problem. Maybe someone with a W$ debugger can do it ?
Anyway, the real original problem (the one that required relative path processing) is the chdir() for extensions execution. The best fix would probably be to get rid of chdir(), but from the comments I've seen about long pathes on W$, I don't think it's realistic :-(