+2004-02-04 Jeffrey Stedfast <fejj@ximian.com>
+
+ Fix for bug #53755 (local folders case)
+
+ * providers/local/camel-mbox-store.c (xrename): No longer takes an
+ exception arg, we just set errno. Our caller can take care of
+ setting an exception.
+ (rename_folder): Don't pass an exception to xrename(), we always
+ overwrote if an error occured it anyway.
+ (rename_folder): Rename the .sbd as well.
+
2004-02-04 Not Zed <NotZed@Ximian.com>
* camel-store.c (camel_store_sync): added 'expunge' parameter,
}
static int
-xrename (CamelStore *store, const char *old_name, const char *new_name, const char *ext, gboolean missingok, CamelException *ex)
+xrename (CamelStore *store, const char *old_name, const char *new_name, const char *ext, gboolean missingok)
{
const char *toplevel_dir = ((CamelLocalStore *) store)->toplevel_dir;
char *oldpath, *newpath;
ret = -1;
}
- if (ret == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not rename %s to %s: %s"),
- oldpath, newpath, g_strerror (err));
- }
-
g_free (oldpath);
g_free (newpath);
rename_folder (CamelStore *store, const char *old, const char *new, CamelException *ex)
{
CamelLocalFolder *folder = NULL;
- char *oldibex, *newibex, *newdir;
+ char *oldibex, *newibex, *newdir, *sbd;
int errnosav;
if (new[0] == '.' || ignore_file (new, TRUE)) {
}
}
- if (xrename (store, old, new, ".ev-summary", TRUE, ex) == -1) {
+ if (xrename (store, old, new, ".ev-summary", TRUE) == -1) {
errnosav = errno;
goto summary_failed;
}
- if (xrename (store, old, new, NULL, FALSE, ex) == -1) {
+ if (xrename (store, old, new, ".sbd", TRUE) == -1) {
+ errnosav = errno;
+ goto subdir_failed;
+ }
+
+ if (xrename (store, old, new, NULL, FALSE) == -1) {
errnosav = errno;
goto base_failed;
}
base_failed:
- xrename (store, new, old, ".ev-summary", TRUE, ex);
+ xrename (store, new, old, ".ev-summary", TRUE);
+
+ subdir_failed:
+
+ xrename (store, new, old, ".sbd", TRUE);
summary_failed:
}
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not rename '%s': %s"),
- old, g_strerror (errnosav));
+ _("Could not rename '%s' to %s: %s"),
+ old, new, g_strerror (errnosav));
g_free (newibex);
g_free (oldibex);