talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 70624e1444384761689e92f6ba935b86ecf9fdd5
parent 49fe15f2d6a2aff965ede7ff7a8cc33a82bf54b5
Author: Ricardo Mones <ricardo@mones.org>
Date:   Tue,  8 Dec 2015 14:18:54 +0100

Cosmetic: use g_strstrip define when stripping

Instead of g_strchomp/g_strchug pairs. Same calls, more readable.

Diffstat:
Msrc/common/mgutils.c | 8+++-----
Msrc/editldap.c | 17++++++++---------
Msrc/editldap_basedn.c | 7+++----
Msrc/exphtmldlg.c | 7+++----
Msrc/expldifdlg.c | 9++++-----
Msrc/importldif.c | 9++++-----
Msrc/importmutt.c | 9++++-----
Msrc/importpine.c | 9++++-----
Msrc/jpilot.c | 8+++-----
Msrc/ldapquery.c | 7+++----
Msrc/ldaputil.c | 8+++-----
Msrc/ldif.c | 7+++----
12 files changed, 45 insertions(+), 60 deletions(-)

diff --git a/src/common/mgutils.c b/src/common/mgutils.c @@ -1,6 +1,6 @@ /* - * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 2001-2012 Match Grun and the Claws Mail team + * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client + * Copyright (C) 2001-2015 Match Grun 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 @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ /* @@ -168,8 +167,7 @@ gchar *mgu_email_check_empty( gchar *address ) { gchar *retVal = NULL; if( address ) { retVal = g_strdup( address ); - retVal = g_strchug( retVal ); - retVal = g_strchomp( retVal ); + retVal = g_strstrip( retVal ); if( *retVal == '\0' ) { g_free( retVal ); retVal = NULL; diff --git a/src/editldap.c b/src/editldap.c @@ -1,6 +1,6 @@ /* - * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 2001-2013 Match Grun and the Claws Mail team + * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client + * Copyright (C) 2001-2015 Match Grun 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 @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ /* @@ -236,9 +235,9 @@ static void edit_ldap_server_check( void ) { ssl = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ldapedit.enable_ssl)); #endif - g_strchomp( sHost ); g_strchug( sHost ); - g_strchomp( sBind ); g_strchug( sBind ); - g_strchomp( sPass ); g_strchug( sPass ); + g_strstrip( sHost ); + g_strstrip( sBind ); + g_strstrip( sPass ); if( *sHost != '\0' ) { /* Test connection to server */ debug_print("ldap server: %s\nport: %d\nssl: %d\ntls: %d\nbindDN: %s\n", sHost, iPort, ssl, tls, sBind); @@ -299,9 +298,9 @@ static void edit_ldap_basedn_select( void ) { ssl = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ldapedit.enable_ssl)); #endif - g_strchomp( sHost ); g_strchug( sHost ); - g_strchomp( sBind ); g_strchug( sBind ); - g_strchomp( sPass ); g_strchug( sPass ); + g_strstrip( sHost ); + g_strstrip( sBind ); + g_strstrip( sPass ); debug_print("ldap server: %s\nport: %d\nssl: %d\ntls: %d\nbindDN: %s\n", sHost, iPort, ssl, tls, sBind); selectDN = edit_ldap_basedn_selection( sHost, iPort, sBase, iTime, sBind, sPass, ssl, tls ); if( selectDN ) { diff --git a/src/editldap_basedn.c b/src/editldap_basedn.c @@ -1,6 +1,6 @@ /* - * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 2001-2012 Match Grun and the Claws Mail team + * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client + * Copyright (C) 2001-2015 Match Grun 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 @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ /* @@ -317,7 +316,7 @@ gchar *edit_ldap_basedn_selection( const gchar *hostName, const gint port, gchar if( ldapedit_basedn_bad_server ) return NULL; retVal = gtk_editable_get_chars( GTK_EDITABLE(ldapedit_basedn.basedn_entry), 0, -1 ); - g_strchomp( retVal ); g_strchug( retVal ); + g_strstrip( retVal ); if( *retVal == '\0' ) { g_free( retVal ); retVal = NULL; diff --git a/src/exphtmldlg.c b/src/exphtmldlg.c @@ -1,6 +1,6 @@ /* - * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 2002-2014 Match Grun and the Claws Mail team + * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client + * Copyright (C) 2002-2015 Match Grun 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 @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ /* @@ -162,7 +161,7 @@ static gboolean exp_html_move_file( void ) { AlertValue aval; sFile = gtk_editable_get_chars( GTK_EDITABLE(exphtml_dlg.entryHtml), 0, -1 ); - g_strchug( sFile ); g_strchomp( sFile ); + g_strstrip( sFile ); gtk_entry_set_text( GTK_ENTRY(exphtml_dlg.entryHtml), sFile ); exporthtml_parse_filespec( _exportCtl_, sFile ); g_free( sFile ); diff --git a/src/expldifdlg.c b/src/expldifdlg.c @@ -1,6 +1,6 @@ /* - * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 2003-2012 Match Grun and the Claws Mail team + * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client + * Copyright (C) 2003-2015 Match Grun 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 @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ /* @@ -165,7 +164,7 @@ static gboolean exp_ldif_move_file( void ) { AlertValue aval; sFile = gtk_editable_get_chars( GTK_EDITABLE(expldif_dlg.entryLdif), 0, -1 ); - g_strchug( sFile ); g_strchomp( sFile ); + g_strstrip( sFile ); gtk_entry_set_text( GTK_ENTRY(expldif_dlg.entryLdif), sFile ); exportldif_parse_filespec( _exportCtl_, sFile ); @@ -221,7 +220,7 @@ static gboolean exp_ldif_move_dn( void ) { /* Set suffix */ suffix = gtk_editable_get_chars( GTK_EDITABLE(expldif_dlg.entrySuffix), 0, -1 ); - g_strchug( suffix ); g_strchomp( suffix ); + g_strstrip( suffix ); /* Set RDN format */ id = combobox_get_active_data(GTK_COMBO_BOX(expldif_dlg.optmenuRDN)); diff --git a/src/importldif.c b/src/importldif.c @@ -1,6 +1,6 @@ /* - * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 2001-2012 Match Grun and the Claws Mail team + * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client + * Copyright (C) 2001-2015 Match Grun 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 @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ /* @@ -434,10 +433,10 @@ static gboolean imp_ldif_file_move() { gboolean errFlag = FALSE; sFile = gtk_editable_get_chars( GTK_EDITABLE(impldif_dlg.entryFile), 0, -1 ); - g_strchug( sFile ); g_strchomp( sFile ); + g_strstrip( sFile ); sName = gtk_editable_get_chars( GTK_EDITABLE(impldif_dlg.entryName), 0, -1 ); - g_strchug( sName ); g_strchomp( sName ); + g_strstrip( sName ); g_free( impldif_dlg.nameBook ); g_free( impldif_dlg.fileName ); diff --git a/src/importmutt.c b/src/importmutt.c @@ -1,6 +1,6 @@ /* - * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 2001-2012 Match Grun and the Claws Mail team + * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client + * Copyright (C) 2001-2015 Match Grun 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 @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ /* @@ -112,11 +111,11 @@ static void imp_mutt_ok( GtkWidget *widget, gboolean *cancelled ) { gboolean errFlag = FALSE; sFile = gtk_editable_get_chars( GTK_EDITABLE(impmutt_dlg.file_entry), 0, -1 ); - g_strchug( sFile ); g_strchomp( sFile ); + g_strstrip( sFile ); gtk_entry_set_text( GTK_ENTRY(impmutt_dlg.file_entry), sFile ); sName = gtk_editable_get_chars( GTK_EDITABLE(impmutt_dlg.name_entry), 0, -1 ); - g_strchug( sName ); g_strchomp( sName ); + g_strstrip( sName ); gtk_entry_set_text( GTK_ENTRY(impmutt_dlg.name_entry), sName ); if( *sFile == '\0'|| strlen( sFile ) < 1 ) { diff --git a/src/importpine.c b/src/importpine.c @@ -1,6 +1,6 @@ /* - * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 2002-2012 Match Grun and the Claws Mail team + * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client + * Copyright (C) 2002-2015 Match Grun 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 @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ /* @@ -111,11 +110,11 @@ static void imp_pine_ok( GtkWidget *widget, gboolean *cancelled ) { gboolean errFlag = FALSE; sFile = gtk_editable_get_chars( GTK_EDITABLE(imppine_dlg.file_entry), 0, -1 ); - g_strchug( sFile ); g_strchomp( sFile ); + g_strstrip( sFile ); gtk_entry_set_text( GTK_ENTRY(imppine_dlg.file_entry), sFile ); sName = gtk_editable_get_chars( GTK_EDITABLE(imppine_dlg.name_entry), 0, -1 ); - g_strchug( sName ); g_strchomp( sName ); + g_strstrip( sName ); gtk_entry_set_text( GTK_ENTRY(imppine_dlg.name_entry), sName ); if( *sFile == '\0'|| strlen( sFile ) < 1 ) { diff --git a/src/jpilot.c b/src/jpilot.c @@ -1,6 +1,6 @@ /* - * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 2001-2012 Match Grun and the Claws Mail team + * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client + * Copyright (C) 2001-2015 Match Grun 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 @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ /* @@ -1353,8 +1352,7 @@ GList *jpilot_load_custom_label( JPilotFile *pilotFile, GList *labelList ) { for( i = 0; i < NUM_CUSTOM_LABEL; i++ ) { gchar *labelName = ai->labels[i+IND_CUSTOM_LABEL]; if( labelName ) { - g_strchomp( labelName ); - g_strchug( labelName ); + g_strstrip( labelName ); if( *labelName != '\0' ) { if( convert_charcode ) { gchar *convertBuff = NULL; diff --git a/src/ldapquery.c b/src/ldapquery.c @@ -1,6 +1,6 @@ /* - * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 2003-2012 Match Grun and the Claws Mail team + * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client + * Copyright (C) 2003-2015 Match Grun 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 @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ /* @@ -507,7 +506,7 @@ static GList *ldapqry_build_items_fl( } } if( fullName ) { - g_strchug( fullName ); g_strchomp( fullName ); + g_strstrip( fullName ); allocated = TRUE; } } diff --git a/src/ldaputil.c b/src/ldaputil.c @@ -1,6 +1,6 @@ /* - * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 2003-2012 Match Grun and the Claws Mail team + * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client + * Copyright (C) 2003-2015 Match Grun 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 @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ /* @@ -174,8 +173,7 @@ static GList *ldaputil_test_v2( LDAP *ld, gint tov ) { ch = ( char * ) strchr( tmp, ':' ); if( ch ) { gchar *bn = g_strdup( ++ch ); - g_strchomp( bn ); - g_strchug( bn ); + g_strstrip( bn ); baseDN = g_list_append( baseDN, g_strdup( bn ) ); g_free( bn ); diff --git a/src/ldif.c b/src/ldif.c @@ -1,6 +1,6 @@ /* - * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 2001-2012 Match Grun and the Claws Mail team + * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client + * Copyright (C) 2001-2015 Match Grun 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 @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ /* @@ -440,7 +439,7 @@ static void ldif_build_items( } if( fullName ) { - g_strchug( fullName ); g_strchomp( fullName ); + g_strstrip( fullName ); } if( rec->listNName ) {