aboutsummaryrefslogtreecommitdiffstats
path: root/filter
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-08-07 11:58:56 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-08-07 11:58:56 +0800
commitf5b0266037111d109d63df72064fe3ee0ddd7dcd (patch)
treec0aec367505f5a38585b78feba90b8fec79a3559 /filter
parent6bdebeda9678e445238803da1b692a53d4641708 (diff)
downloadgsoc2013-evolution-f5b0266037111d109d63df72064fe3ee0ddd7dcd.tar
gsoc2013-evolution-f5b0266037111d109d63df72064fe3ee0ddd7dcd.tar.gz
gsoc2013-evolution-f5b0266037111d109d63df72064fe3ee0ddd7dcd.tar.bz2
gsoc2013-evolution-f5b0266037111d109d63df72064fe3ee0ddd7dcd.tar.lz
gsoc2013-evolution-f5b0266037111d109d63df72064fe3ee0ddd7dcd.tar.xz
gsoc2013-evolution-f5b0266037111d109d63df72064fe3ee0ddd7dcd.tar.zst
gsoc2013-evolution-f5b0266037111d109d63df72064fe3ee0ddd7dcd.zip
Don't need to save temp/backup files anymore, e_xml_save_file() now
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" svn path=/trunk/; revision=17727
Diffstat (limited to 'filter')
-rw-r--r--filter/ChangeLog7
-rw-r--r--filter/rule-context.c18
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;
}