Index: src/file_autosave.c
===================================================================
--- src/file_autosave.c (revision 6096)
+++ src/file_autosave.c (working copy)
@@ -1,7 +1,7 @@
/* Bluefish HTML Editor
* file_autosave.c - autosave
*
- * Copyright (C) 2009 Olivier Sessink
+ * Copyright (C) 2009-2010 Olivier Sessink
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -227,8 +227,11 @@
doc->autosave_uri = create_autosave_path(doc, hasht);
g_hash_table_insert(hasht, g_file_get_path(doc->autosave_uri), GINT_TO_POINTER(1));
}
+
buffer = refcpointer_new(doc_get_chars(doc, 0, -1));
- doc->autosave_action = file_checkNsave_uri_async(doc->autosave_uri, NULL, buffer, strlen(buffer->data), FALSE, FALSE, (CheckNsaveAsyncCallback)autosave_complete_lcb, doc);
+ if (buffer->data) {
+ doc->autosave_action = file_checkNsave_uri_async(doc->autosave_uri, NULL, buffer, strlen(buffer->data), FALSE, FALSE, (CheckNsaveAsyncCallback)autosave_complete_lcb, doc);
+ }
refcpointer_unref(buffer);
}
@@ -268,7 +271,7 @@
while (tmplist) {
gchar **arr = (gchar **)tmplist->data;
GFile *recover_uri;
- if (count_array(arr)!=3) {
+ if (g_strv_length(arr)!=3) {
tmplist = g_list_next(tmplist);
continue;
}