I fixed that bug, it was about incoretly saving the search path in the
file open/save dialog box.
I also found anoder bug and corrected it: deleting the Blank Split caused a
coredump. this was due to the fact that there exists a pointer to the
Blank split in the SplitRegister object (user_hook), that is left in place
when the split is deleted. The code tries later to use that split, since
the test is user_hook != NULL.
The solution is to check whether the deleted split is the Blank split,
and refuse to delete it.
I've attached a diff file with the modifications I've made. They are based
on the latest CVS version.
Best Regards,
alex.
On Sat, 20 Feb 1999, Jeremy Collins wrote:
> There appears to be a bug in the Motif code. Here is how you reproduce
> it. Open a file or create a new one. Then choose "Save As..." from the
> menu. Give it a name, lets say test.xac. Then choose to "Import QIF"
> from the menu. You get a filter as follows:
>
> /home/collins/test.xac/*.qif
>
> Obviously it should be:
>
> /home/collins/*.qif
>
> Probably something simple. I haven't really looked at it.
>
> --
> Jeremy Collins
> [EMAIL PROTECTED]
> ----- %< -------------------------------------------- >% ------
> The GnuCash / X-Accountant Mailing List
> To unsubscribe, send mail to [EMAIL PROTECTED] and
> put "unsubscribe gnucash-devel [EMAIL PROTECTED]" in the body
>
diff -r -u -B xacc/src/motif/FileBox.c my-xacc/src/motif/FileBox.c
--- xacc/src/motif/FileBox.c Thu Jan 21 09:48:25 1999
+++ my-xacc/src/motif/FileBox.c Sun Feb 28 16:52:02 1999
@@ -27,6 +27,9 @@
#include <Xm/Xm.h>
#include <Xm/FileSB.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
#include "config.h"
#include "FileBox.h"
@@ -159,11 +162,17 @@
* time they get to this box.
*/
if (fileName) {
- char *slash;
- if (previous_path) free (previous_path);
- previous_path = strdup (fileName);
- slash = strrchr (previous_path, '/');
+ char *slash, *new_path;
+ struct stat s;
+
+ new_path = strdup (fileName);
+ slash = strrchr (new_path, '/');
if (slash) { *(slash+1) = 0x0; }
+ if((0 == stat(new_path, &s)) && S_ISDIR(s.st_mode)) {
+ if (previous_path) free (previous_path);
+ previous_path = new_path;
+ } else
+ free(new_path);
}
LEAVE("fileBox");
diff -r -u -B xacc/src/motif/RegWindow.c my-xacc/src/motif/RegWindow.c
--- xacc/src/motif/RegWindow.c Wed Feb 3 11:53:25 1999
+++ my-xacc/src/motif/RegWindow.c Sun Feb 28 17:24:27 1999
@@ -921,6 +921,8 @@
/* get the current split based on cursor position */
split = xaccSRGetCurrentSplit (regData->ledger->ledger);
+ /* we don't delete the blank split */
+ if(split == regData->ledger->ledger->user_hook) return;
if (NULL == split ) return;
/* ask for user confirmation before performing