Re: the location of "sheets" passed to Dia



At 20.12.2008 09:15, Sameer Sahasrabuddhe wrote:
On Sat, Dec 20, 2008 at 3:41 AM, Hans Breuer <hans breuer org> wrote:

lib/sheet.c(load_all_sheets) has

 sheet_path = getenv("DIA_SHEET_PATH");

OK. So the location of sheets is taken from one of two places:
1) If the environment variable is set, then it is used
2) else a path relative to the compile-time variable DATADIR is used.

In that case, some code in object/SISSI is broken.
Yes, unfortunately not only some :) E.g. passing the result of dia_get_data_directory() directly into g_strdup() leaks. But there is more:
http://bugzilla.gnome.org/show_bug.cgi?id=355995

For example,
sissi_object_create() in SISSI/sissi_object.c ... it directly calls
dia_get_data_directory() when loading a sheet, without checking the
environment variable.
SISSI is abusing some dialect of diagram files to simulate something shape-file like. I'm not eager to support that hack from the core.

The correct fix is to extract the code in
lib/sheet.c into a new function called dia_get_sheets_directory(),
which can be used wherever the name of the sheets directory is
required.

A patch which cleans up SISSI would be appreciated. But as said above the fix should be local to the plug-in.

Thanks,
        Hans

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it.                -- Dilbert



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]