/*
- * 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
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
*/
/*
}
}
if( fullName ) {
- g_strchug( fullName ); g_strchomp( fullName );
+ g_strstrip( fullName );
allocated = TRUE;
}
}
if (attrib->name && strcmp(attrib->name, "jpegPhoto")) {
addritem_person_add_attribute( person, attrib );
} else {
- if (qry && qry->server && qry->server->control) {
+ if (qry->server && qry->server->control) {
gchar *dir = g_strconcat( get_rc_dir(), G_DIR_SEPARATOR_S,
ADDRBOOK_DIR, G_DIR_SEPARATOR_S, NULL );
gchar *filename = g_strdup_printf("%s-%s-%s",
if( ber != NULL ) {
ber_free( ber, 0 );
}
- g_free( dnEntry );
+ ldap_memfree( dnEntry );
return listReturn;
}
}
ADDRQUERY_RETVAL(qry) = LDAPRC_STOP_FLAG;
+#ifdef G_OS_WIN32
+ debug_print("Total results are: %lu\n", ldap_count_entries(ld, result));
+#else
debug_print("Total results are: %d\n", ldap_count_entries(ld, result));
+#endif
/* Process results */
first = TRUE;
qry->thread = g_malloc0( sizeof( pthread_t ) );
/* Setup thread */
- pthread_create( qry->thread, NULL,
- (void *) ldapqry_search, (void *) qry );
+ if (pthread_create( qry->thread, NULL,
+ (void *) ldapqry_search, (void *) qry ) != 0) {
+ g_free(qry->thread);
+ qry->thread = NULL;
+ ADDRQUERY_RETVAL(qry) = LDAPRC_SEARCH;
+ }
}
}
return ADDRQUERY_RETVAL(qry);
return ADDRQUERY_RETVAL(qry);
}
+#ifdef G_OS_WIN32
+ debug_print("Total results are: %lu\n", ldap_count_entries(ld, result));
+#else
debug_print("Total results are: %d\n", ldap_count_entries(ld, result));
+#endif
/* Process results */
ADDRQUERY_RETVAL(qry) = LDAPRC_STOP_FLAG;