Make sure the new description isn't the same as the old description
2001-10-17 Jeffrey Stedfast <fejj@ximian.com> * camel-exception.c (camel_exception_set): Make sure the new description isn't the same as the old description pointer before freeing the old one. (camel_exception_setv): Don't free the old description until we set the new one this way we can reuse the old description in the new description. * providers/local/camel-mbox-folder.c (mbox_append_message): If errno == EINTR, then we got a user-cancel so set the exception appropriately so that we don't make the user shit his pants. svn path=/trunk/; revision=13737
This commit is contained in:

committed by
Jeffrey Stedfast

parent
4ddd273ac4
commit
982357f35c
@ -1,5 +1,16 @@
|
|||||||
2001-10-17 Jeffrey Stedfast <fejj@ximian.com>
|
2001-10-17 Jeffrey Stedfast <fejj@ximian.com>
|
||||||
|
|
||||||
|
* camel-exception.c (camel_exception_set): Make sure the new
|
||||||
|
description isn't the same as the old description pointer before
|
||||||
|
freeing the old one.
|
||||||
|
(camel_exception_setv): Don't free the old description until we
|
||||||
|
set the new one this way we can reuse the old description in the
|
||||||
|
new description.
|
||||||
|
|
||||||
|
* providers/local/camel-mbox-folder.c (mbox_append_message): If
|
||||||
|
errno == EINTR, then we got a user-cancel so set the exception
|
||||||
|
appropriately so that we don't make the user shit his pants.
|
||||||
|
|
||||||
* camel-filter-driver.c (do_copy): Add an optimization for when
|
* camel-filter-driver.c (do_copy): Add an optimization for when
|
||||||
destination folder is the same as the source folder.
|
destination folder is the same as the source folder.
|
||||||
|
|
||||||
|
@ -160,9 +160,10 @@ camel_exception_set (CamelException *ex,
|
|||||||
|
|
||||||
ex->id = id;
|
ex->id = id;
|
||||||
|
|
||||||
if (ex->desc)
|
if (desc != ex->desc) {
|
||||||
g_free(ex->desc);
|
g_free (ex->desc);
|
||||||
ex->desc = g_strdup(desc);
|
ex->desc = g_strdup (desc);
|
||||||
|
}
|
||||||
|
|
||||||
CAMEL_EXCEPTION_UNLOCK(exception);
|
CAMEL_EXCEPTION_UNLOCK(exception);
|
||||||
}
|
}
|
||||||
@ -195,19 +196,21 @@ camel_exception_setv (CamelException *ex,
|
|||||||
...)
|
...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
|
char *old;
|
||||||
|
|
||||||
if (!ex)
|
if (!ex)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CAMEL_EXCEPTION_LOCK(exception);
|
CAMEL_EXCEPTION_LOCK(exception);
|
||||||
|
|
||||||
if (ex->desc)
|
old = ex->desc;
|
||||||
g_free (ex->desc);
|
|
||||||
|
|
||||||
va_start(args, format);
|
va_start(args, format);
|
||||||
ex->desc = g_strdup_vprintf (format, args);
|
ex->desc = g_strdup_vprintf (format, args);
|
||||||
va_end (args);
|
va_end (args);
|
||||||
|
|
||||||
|
g_free (old);
|
||||||
|
|
||||||
ex->id = id;
|
ex->id = id;
|
||||||
|
|
||||||
CAMEL_EXCEPTION_UNLOCK(exception);
|
CAMEL_EXCEPTION_UNLOCK(exception);
|
||||||
|
@ -261,10 +261,14 @@ mbox_append_message(CamelFolder *folder, CamelMimeMessage * message, const Camel
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
fail_write:
|
fail_write:
|
||||||
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
|
if (errno == EINTR)
|
||||||
_("Cannot append message to mbox file: %s: %s"),
|
camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
|
||||||
lf->folder_path, g_strerror (errno));
|
_("Mail append cancelled"));
|
||||||
|
else
|
||||||
|
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
|
||||||
|
_("Cannot append message to mbox file: %s: %s"),
|
||||||
|
lf->folder_path, g_strerror (errno));
|
||||||
|
|
||||||
if (filter_stream)
|
if (filter_stream)
|
||||||
camel_object_unref(CAMEL_OBJECT(filter_stream));
|
camel_object_unref(CAMEL_OBJECT(filter_stream));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user