diff options
-rw-r--r-- | filter/ChangeLog | 7 | ||||
-rw-r--r-- | filter/rule-context.c | 18 |
2 files changed, 10 insertions, 15 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog index 9175a65ed0..496a401448 100644 --- a/filter/ChangeLog +++ b/filter/ChangeLog @@ -1,5 +1,12 @@ 2002-08-06 Jeffrey Stedfast <fejj@ximian.com> + * rule-context.c (save): Don't need to save temp/backup files + anymore, e_xml_save_file() now handles this for us (well, at least + the saving of temp files). I'm not sure we need a backup file + anymore now that we can depend on e_xml_save_file() to "Just Work" + +2002-08-06 Jeffrey Stedfast <fejj@ximian.com> + * rule-context.c (save): Use e_xml_save_file(). (xml_doc_save): Removed this code and added it to gal so that e-table and all other parts of evolution and so forth could use diff --git a/filter/rule-context.c b/filter/rule-context.c index 2f84dc496f..f27a13df0e 100644 --- a/filter/rule-context.c +++ b/filter/rule-context.c @@ -391,7 +391,6 @@ save (RuleContext *f, const char *user) GList *l; FilterRule *rule; struct _rule_set_map *map; - char *usersav, *userbak, *slash; int ret; doc = xmlNewDoc ("1.0"); @@ -411,21 +410,10 @@ save (RuleContext *f, const char *user) l = g_list_next (l); } - usersav = alloca(strlen(user)+5); - userbak = alloca(strlen(user)+5); - slash = strrchr(user, '/'); - if (slash) - sprintf(usersav, "%.*s.#%s", slash-user+1, user, slash+1); - else - sprintf(usersav, ".#%s", user); - sprintf(userbak, "%s~", user); - d(printf("saving rules to '%s' then backup '%s'\n", usersav, userbak)); - ret = e_xml_save_file (usersav, doc); - if (ret != -1) { - rename(user, userbak); - ret = rename(usersav, user); - } + ret = e_xml_save_file (user, doc); + xmlFreeDoc (doc); + return ret; } |