commit f3d3586ed9e32033eefa3f76c9bbb1ee1fdfbf55
parent 6fc7c18a8105bfb51879ada01e0f49c1bd72ff83
Author: Ricardo Mones <ricardo@mones.org>
Date: Mon, 18 May 2015 21:44:50 +0200
Almost switch plugins from strerror to g_strerror
Refusing to modify spamassassin's libspamc.c code to avoid
diverging (more) from original ASF code. It's a pity they
don't provide a shared library for this, or at least for the
message_read/message_filter functions used by the plugin :)
Diffstat:
5 files changed, 25 insertions(+), 32 deletions(-)
diff --git a/src/plugins/fancy/fancy_viewer.c b/src/plugins/fancy/fancy_viewer.c
@@ -1,20 +1,22 @@
/*
* Claws Mail -- A GTK+ based, lightweight, and fast e-mail client
* == Fancy Plugin ==
- * Copyright(C) 1999-2014 the Claws Mail Team
+ * Copyright(C) 1999-2015 the Claws Mail Team
* This file Copyright (C) 2009-2014 Salvatore De Paolis
* <iwkse@claws-mail.org> and the Claws Mail Team
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write tothe Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -420,7 +422,7 @@ static void resource_request_starting_cb(WebKitWebView *view,
}
if ((err = procmime_get_part(filename, partinfo)) < 0)
alertpanel_error(_("Couldn't save the part of multipart message: %s"),
- strerror(-err));
+ g_strerror(-err));
gchar *file_uri = g_filename_to_uri(filename, NULL, NULL);
webkit_network_request_set_uri(request, file_uri);
g_free(file_uri);
diff --git a/src/plugins/newmail/newmail.c b/src/plugins/newmail/newmail.c
@@ -1,10 +1,10 @@
/*
* newmail - A plugin for Claws Mail
*
- * Copyright (C) 2005-2005 H.Merijn Brand and the Claws Mail Team
+ * Copyright (C) 2005-2015 H.Merijn Brand and the Claws Mail Team
*
- * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2013 the Claws Mail Team
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2015 the Claws Mail Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,8 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <errno.h>
@@ -129,17 +128,9 @@ gint plugin_init (gchar **error)
g_free(LogName);
LogName = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, LOG_NAME, NULL);
if (!(NewLog = fopen (LogName, mode))) {
- char buf[BUFSIZE];
-
debug_print ("Failed to open fallback log %s\n", LogName);
-#if (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && ! _GNU_SOURCE
- strerror_r(errno, buf, BUFSIZE);
- *error = g_strdup_printf(_("Could not open log file %s: %s\n"),
- LogName, buf);
-#else /* use GNU version */
*error = g_strdup_printf(_("Could not open log file %s: %s\n"),
- LogName, strerror_r(errno, buf, BUFSIZE));
-#endif
+ LogName, g_strerror(errno));
plugin_done ();
return (-1);
}
diff --git a/src/plugins/pgpcore/sgpgme.c b/src/plugins/pgpcore/sgpgme.c
@@ -1,6 +1,6 @@
/*
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2014 the Claws Mail team
+ * Copyright (C) 1999-2015 the Claws Mail team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,14 +14,14 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ *
*/
-
+
#ifdef HAVE_CONFIG_H
# include "config.h"
#include "claws-features.h"
#endif
-
+
#ifdef USE_GPGME
#include <time.h>
@@ -467,7 +467,7 @@ gpgme_data_t sgpgme_decrypt_verify(gpgme_data_t cipher, gpgme_verify_result_t *s
err = cm_gpgme_data_rewind(plain);
if (err) {
- debug_print("can't seek (%d %d %s)\n", err, errno, strerror(errno));
+ debug_print("can't seek (%d %d %s)\n", err, errno, g_strerror(errno));
}
debug_print("decrypted.\n");
@@ -484,7 +484,7 @@ gpgme_data_t sgpgme_decrypt_verify(gpgme_data_t cipher, gpgme_verify_result_t *s
err = cm_gpgme_data_rewind(plain);
if (err) {
- debug_print("can't seek (%d %d %s)\n", err, errno, strerror(errno));
+ debug_print("can't seek (%d %d %s)\n", err, errno, g_strerror(errno));
}
debug_print("decrypted.\n");
diff --git a/src/plugins/pgpinline/pgpinline.c b/src/plugins/pgpinline/pgpinline.c
@@ -1,6 +1,6 @@
/*
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2014 Colin Leroy <colin@colino.net> and
+ * Copyright (C) 1999-2015 Colin Leroy <colin@colino.net> and
* the Claws Mail team
*
* This program is free software; you can redistribute it and/or modify
@@ -15,7 +15,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ *
*/
#ifdef HAVE_CONFIG_H
@@ -694,7 +694,7 @@ static gboolean pgpinline_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
fp = my_tmpfile();
if (fp == NULL) {
- privacy_set_error(_("Couldn't create temporary file, %s"), strerror(errno));
+ privacy_set_error(_("Couldn't create temporary file, %s"), g_strerror(errno));
perror("my_tmpfile");
g_free(kset);
return FALSE;
diff --git a/src/plugins/pgpmime/pgpmime.c b/src/plugins/pgpmime/pgpmime.c
@@ -1,6 +1,6 @@
/*
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2014 the Claws Mail team
+ * Copyright (C) 1999-2015 the Claws Mail team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ *
*/
#ifdef HAVE_CONFIG_H
@@ -453,7 +453,7 @@ gboolean pgpmime_sign(MimeInfo *mimeinfo, PrefsAccount *account, const gchar *fr
fp = my_tmpfile();
if (fp == NULL) {
- privacy_set_error(_("Couldn't create temporary file: %s"), strerror(errno));
+ privacy_set_error(_("Couldn't create temporary file: %s"), g_strerror(errno));
return FALSE;
}
procmime_write_mimeinfo(mimeinfo, fp);
@@ -492,7 +492,7 @@ gboolean pgpmime_sign(MimeInfo *mimeinfo, PrefsAccount *account, const gchar *fr
fp = my_tmpfile();
if (fp == NULL) {
perror("my_tmpfile");
- privacy_set_error(_("Couldn't create temporary file: %s"), strerror(errno));
+ privacy_set_error(_("Couldn't create temporary file: %s"), g_strerror(errno));
return FALSE;
}
procmime_write_mimeinfo(sigmultipart, fp);
@@ -687,7 +687,7 @@ gboolean pgpmime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
/* write message content to temporary file */
fp = my_tmpfile();
if (fp == NULL) {
- privacy_set_error(_("Couldn't create temporary file, %s"), strerror(errno));
+ privacy_set_error(_("Couldn't create temporary file, %s"), g_strerror(errno));
g_free(kset);
return FALSE;
}