aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-11-11 14:40:28 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-11-11 14:40:28 +0800
commite1ef0a9ced256cb86d19b379c3097efdbcdb498e (patch)
treea4dcceeaecae46ce8b14fe631fca952ba29d97aa /camel
parent3eabd14ace6523781473486b533b8e4ac355fc14 (diff)
downloadgsoc2013-evolution-e1ef0a9ced256cb86d19b379c3097efdbcdb498e.tar.gz
gsoc2013-evolution-e1ef0a9ced256cb86d19b379c3097efdbcdb498e.tar.zst
gsoc2013-evolution-e1ef0a9ced256cb86d19b379c3097efdbcdb498e.zip
Use g_strerror when setting an exception string (we need it to be in
2002-11-11 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-folder.c (get_message_simple): Use g_strerror when setting an exception string (we need it to be in UTF-8). * providers/pop3/camel-pop3-store.c (pop3_try_authenticate): Use g_strerror when setting an exception string (we need it to be in UTF-8). * providers/pop3/camel-pop3-folder.c (pop3_refresh_info): Use g_strerror when setting an exception string (we need it to be in UTF-8). (pop3_get_message): Same. svn path=/trunk/; revision=18690
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog13
-rw-r--r--camel/providers/imap/camel-imap-command.c6
-rw-r--r--camel/providers/imap/camel-imap-folder.c3
-rw-r--r--camel/providers/pop3/camel-pop3-folder.c19
-rw-r--r--camel/providers/pop3/camel-pop3-store.c5
-rw-r--r--camel/providers/pop3/camel-pop3-stream.c2
6 files changed, 36 insertions, 12 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index a7490409c5..3a5d115458 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,18 @@
2002-11-11 Jeffrey Stedfast <fejj@ximian.com>
+ * providers/imap/camel-imap-folder.c (get_message_simple): Use
+ g_strerror when setting an exception string (we need it to be in
+ UTF-8).
+
+ * providers/pop3/camel-pop3-store.c (pop3_try_authenticate): Use
+ g_strerror when setting an exception string (we need it to be in
+ UTF-8).
+
+ * providers/pop3/camel-pop3-folder.c (pop3_refresh_info): Use
+ g_strerror when setting an exception string (we need it to be in
+ UTF-8).
+ (pop3_get_message): Same.
+
* providers/local/camel-spool-summary.c (spool_summary_sync_full):
Use g_strerror when setting an exception string (we need it to be
in UTF-8).
diff --git a/camel/providers/imap/camel-imap-command.c b/camel/providers/imap/camel-imap-command.c
index 13a472f5b5..25d7bbd022 100644
--- a/camel/providers/imap/camel-imap-command.c
+++ b/camel/providers/imap/camel-imap-command.c
@@ -448,9 +448,11 @@ imap_read_untagged (CamelImapStore *store, char *line, CamelException *ex)
nread = camel_stream_read (store->istream, str->str + 1, length);
if (nread == -1) {
if (errno == EINTR)
- camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("Operation cancelled"));
+ camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
+ _("Operation cancelled"));
else
- camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, g_strerror (errno));
+ camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
+ g_strerror (errno));
camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL);
g_string_free (str, TRUE);
goto lose;
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 228e8689e0..e95904027a 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -1869,7 +1869,8 @@ get_message_simple (CamelImapFolder *imap_folder, const char *uid,
camel_object_unref (CAMEL_OBJECT (stream));
if (ret == -1) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("Unable to retrieve message: %s"), strerror(errno));
+ _("Unable to retrieve message: %s"),
+ g_strerror (errno));
camel_object_unref (CAMEL_OBJECT (msg));
return NULL;
}
diff --git a/camel/providers/pop3/camel-pop3-folder.c b/camel/providers/pop3/camel-pop3-folder.c
index ca93bc9fc5..1aef811e23 100644
--- a/camel/providers/pop3/camel-pop3-folder.c
+++ b/camel/providers/pop3/camel-pop3-folder.c
@@ -261,7 +261,9 @@ pop3_refresh_info (CamelFolder *folder, CamelException *ex)
if (errno == EINTR)
camel_exception_setv(ex, CAMEL_EXCEPTION_USER_CANCEL, _("User cancelled"));
else
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot get POP summary: %s"), strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Cannot get POP summary: %s"),
+ g_strerror (errno));
}
/* TODO: check every id has a uid & commands returned OK too? */
@@ -426,7 +428,9 @@ pop3_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
if (fi->err == EINTR)
camel_exception_setv(ex, CAMEL_EXCEPTION_USER_CANCEL, _("User cancelled"));
else
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot get message %s: %s"), uid, strerror(fi->err));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Cannot get message %s: %s"),
+ uid, g_strerror (fi->err));
goto fail;
}
}
@@ -485,12 +489,13 @@ pop3_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
if (fi->err == EINTR)
camel_exception_setv(ex, CAMEL_EXCEPTION_USER_CANCEL, _("User cancelled"));
else
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot get message %s: %s"), uid, strerror(fi->err));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Cannot get message %s: %s"),
+ uid, g_strerror (fi->err));
goto done;
}
- if (camel_stream_read(stream, buffer, 1) != 1
- || buffer[0] != '#') {
+ if (camel_stream_read(stream, buffer, 1) != 1 || buffer[0] != '#') {
camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID,
_("Cannot get message %s: %s"), uid, _("Unknown reason"));
goto done;
@@ -502,7 +507,9 @@ pop3_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
if (errno == EINTR)
camel_exception_setv(ex, CAMEL_EXCEPTION_USER_CANCEL, _("User cancelled"));
else
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot get message %s: %s"), uid, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Cannot get message %s: %s"),
+ uid, g_strerror (errno));
camel_object_unref((CamelObject *)message);
message = NULL;
}
diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c
index 20c5640779..6452cb6a47 100644
--- a/camel/providers/pop3/camel-pop3-store.c
+++ b/camel/providers/pop3/camel-pop3-store.c
@@ -513,9 +513,10 @@ pop3_try_authenticate (CamelService *service, const char *errmsg,
camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("Cancelled"));
} else {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Unable to connect to POP server %s.\nError sending password: %s"),
+ _("Unable to connect to POP server %s.\n"
+ "Error sending password: %s"),
CAMEL_SERVICE (store)->url->host,
- errno ? strerror (errno) : _("Unknown error"));
+ errno ? g_strerror (errno) : _("Unknown error"));
}
} else if (pcp->state != CAMEL_POP3_COMMAND_OK)
camel_exception_setv(ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
diff --git a/camel/providers/pop3/camel-pop3-stream.c b/camel/providers/pop3/camel-pop3-stream.c
index 5b0dd979ca..23b9b1e040 100644
--- a/camel/providers/pop3/camel-pop3-stream.c
+++ b/camel/providers/pop3/camel-pop3-stream.c
@@ -64,7 +64,7 @@ stream_fill(CamelPOP3Stream *is)
is->end[0] = '\n';
return is->end - is->ptr;
} else {
- dd(printf("POP3_STREAM_FILL(ERROR): '%s'\n", strerror(errno)));
+ dd(printf("POP3_STREAM_FILL(ERROR): '%s'\n", strerror (errno)));
return -1;
}
}