Bug 587853 (Gnucash 2.3.1 transaction log open fails) possibly solved
James Raehl
jimraehl at raehls.us
Wed Jul 8 22:34:57 EDT 2009
Has anyone noticed that Windows (at least) Gnucash 2.3.1 hasn't been generating transaction log files for XML databases? If you update a data file DATA.XML, Gnucash 2.2.9 creates DATA.LOG and backs up to DATA.XAC. 2.3.1 for Windows didn't create the log files.
I noticed a similar bug with the new "File" type for File > Open, per http://svn.gnucash.org/trac/changeset/18178 -- an error message appeared with the filename prefixed with // and the file was not opened.
It appears that in src/engine/gnc-filepath-utils.c, the filename input to routine xccResolveFilePath is of the form "file://path/filename", where "file://" appears to be a filetype tag. The routine deletes "file:" but leaves the "//". Gnucash then tries to open "//path/filename". This also happens for xml:// files.
I changed the code in my source copy to check for "file://" and get rid of the "//" too if found. Both bugs now seem to be solved.
The fixed fragment for "file://" is (a similar one for XML):
if (!g_ascii_strncasecmp(filefrag, "file:", 5))
{
LEAVE("filefrag is file uri");
if (!g_ascii_strncasecmp(filefrag, "file://", 7))
return g_strdup(filefrag + 7);
else
return g_strdup(filefrag + 5);
}
I don't know if my solution will cause other problems, since I don't know the intricacies of the file tags. I don't know if there are similar problems elsewhere that need to be fixed. Any suggestions are appreciated.
Jim Raehl
More information about the gnucash-devel
mailing list