To be honest, the whole NautilusQuery code needs a rewrite. It's entirely inadequate and sub-par (e.g. the usage of g_file_test() before opening the file is a race, g_file_get_contents() is sync. i/o, etc). Could do a couple of band-aid patches to prevent it from crashing, but this is probably a fairly rare crash:
To be honest, the whole NautilusQuery code needs a rewrite. It's entirely inadequate and sub-par (e.g. the usage of g_file_test() before opening the file is a race, g_file_ get_contents( ) is sync. i/o, etc). Could do a couple of band-aid patches to prevent it from crashing, but this is probably a fairly rare crash:
diff --git a/libnautilus- private/ nautilus- query.c b/libnautilus- private/ nautilus private/ nautilus- query.c private/ nautilus- query.c
NautilusQuery *query; TEST_EXISTS) ) {
return NULL;
index 267620d..b6a3f55 100644
--- a/libnautilus-
+++ b/libnautilus-
@@ -300,15 +300,18 @@ nautilus_query_load (char *file)
char *xml;
gsize xml_len;
-
+
+ xml_len = 0;
+ query = NULL;
+
if (!g_file_test (file, G_FILE_
}
-
- g_file_get_contents (file, &xml, &xml_len, NULL); query_parse_ xml (xml, xml_len); get_contents (file, &xml, &xml_len, NULL) && xml_len != 0) { query_parse_ xml (xml, xml_len);
- query = nautilus_
+ if (g_file_
+ query = nautilus_
+ }
(then we have to make sure that the code's doing the right thing with the NULL return, etc)