* broken-date-parser.c (get_wday, get_month)
* camel-folder-search.c (check_header)
* camel-http-stream.c (http_connect, http_get_statuscode)
- * camel-mime-filter-enriched.c (param_parse_colour, enriched_to_html):
- Use g_ascii_str(n)casecmp() instead of str(n)casecmp(). The
- strings we are comparing in these cases should be just ASCII
- anyway, so spell it out that we really do need ASCII casefolding
- only.
+ * camel-mime-filter-enriched.c (param_parse_colour, enriched_to_html)
+ * camel-mime-part.c
+ * camel-mime-utils.c
+ * camel-movemail.c
+ * camel-sasl-popb4smtp.c
+ * camel-string-utils.c
+ * camel-url.c: Use g_ascii_str(n)casecmp() instead of
+ str(n)casecmp(). The strings we are comparing in these cases
+ should be just ASCII anyway, so spell it out that we really do
+ need ASCII casefolding only.
* camel-debug.c: Use e_util_pthread_id() to identify threads.
#include <ctype.h>
#include <errno.h>
-#include <libedataserver/e-iconv.h>
+#include "libedataserver/e-iconv.h"
-#include "camel-mime-parser.h"
-#include "camel-stream-mem.h"
-#include "camel-stream-filter.h"
+#include "camel-charset-map.h"
+#include "camel-exception.h"
#include "camel-mime-filter-basic.h"
-#include "camel-mime-filter-crlf.h"
#include "camel-mime-filter-charset.h"
-#include "camel-mime-part.h"
+#include "camel-mime-filter-crlf.h"
+#include "camel-mime-parser.h"
#include "camel-mime-part-utils.h"
+#include "camel-mime-part.h"
#include "camel-mime-utils.h"
-#include "camel-exception.h"
-#include "camel-charset-map.h"
+#include "camel-stream-filter.h"
+#include "camel-stream-mem.h"
#include "camel-string-utils.h"
#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
process_header((CamelMedium *)dw, "content-type", content);
while (headers) {
- if (strcasecmp(headers->name, "content-type") == 0
+ if (g_ascii_strcasecmp(headers->name, "content-type") == 0
&& headers->value != content)
camel_medium_add_header((CamelMedium *)dw, "X-Invalid-Content-Type", headers->value);
else
#endif
#include <glib.h>
-#include <libedataserver/e-iconv.h>
-#include <libedataserver/e-time-utils.h>
-#include "camel-mime-utils.h"
+#include "libedataserver/e-iconv.h"
+#include "libedataserver/e-time-utils.h"
+
#include "camel-charset-map.h"
+#include "camel-mime-utils.h"
#include "camel-net-utils.h"
#include "camel-utf8.h"
#include "broken-date-parser.h"
#endif
+#ifdef G_OS_WIN32
+/* Undef the similar macro from pthread.h, it doesn't check if
+ * gmtime() returns NULL.
+ */
+#undef gmtime_r
+
+/* The gmtime() in Microsoft's C library is MT-safe */
+#define gmtime_r(tp,tmp) (gmtime(tp)?(*(tmp)=*gmtime(tp),(tmp)):0)
+#endif
+
#if 0
int strdup_count = 0;
int malloc_count = 0;
ascii = g_alloca (bufflen);
- if (strcasecmp (type, "UTF-8") != 0)
+ if (g_ascii_strcasecmp (type, "UTF-8") != 0)
ic = e_iconv_open (type, "UTF-8");
while (inlen) {
{
/* no type == text/plain or text/"*" */
if (ct==NULL || (ct->type == NULL && ct->subtype == NULL)) {
- return (!strcasecmp(type, "text")
+ return (!g_ascii_strcasecmp(type, "text")
&& (!g_ascii_strcasecmp(subtype, "plain")
- || !strcasecmp(subtype, "*")));
+ || !strcmp(subtype, "*")));
}
return (ct->type != NULL
&& (!g_ascii_strcasecmp(ct->type, type)
&& ((ct->subtype != NULL
&& !g_ascii_strcasecmp(ct->subtype, subtype))
- || !strcasecmp("*", subtype))));
+ || !strcmp("*", subtype))));
}
inptr++;
subtype = decode_token(&inptr);
}
- if (subtype == NULL && (!strcasecmp(type, "text"))) {
+ if (subtype == NULL && (!g_ascii_strcasecmp(type, "text"))) {
w(g_warning("text type with no subtype, resorting to text/plain: %s", in));
subtype = g_strdup("plain");
}
/* debug */
#if 0
- if (!strcasecmp(name, "To")) {
+ if (!g_ascii_strcasecmp(name, "To")) {
printf("- Decoding To\n");
camel_header_to_decode(value);
- } else if (!strcasecmp(name, "Content-type")) {
+ } else if (!g_ascii_strcasecmp(name, "Content-type")) {
printf("- Decoding content-type\n");
camel_content_type_dump(camel_content_type_decode(value));
- } else if (!strcasecmp(name, "MIME-Version")) {
+ } else if (!g_ascii_strcasecmp(name, "MIME-Version")) {
printf("- Decoding mime version\n");
camel_header_mime_decode(value);
}
iv[3].iov_len = 1;
while (header) {
- if (strcasecmp(header->name, "Content-Length")) {
+ if (g_ascii_strcasecmp(header->name, "Content-Length")) {
iv[0].iov_base = header->name;
iv[0].iov_len = strlen(header->name);
iv[2].iov_base = header->value;
#include <string.h>
#include <time.h>
+#include "camel-i18n.h"
#include "camel-sasl-popb4smtp.h"
#include "camel-service.h"
#include "camel-session.h"
-#include "camel-i18n.h"
CamelServiceAuthType camel_sasl_popb4smtp_authtype = {
N_("POP before SMTP"),
return NULL;
}
- if (strncasecmp(popuri, "pop:", 4) != 0) {
+ if (g_ascii_strncasecmp(popuri, "pop:", 4) != 0) {
camel_exception_setv(ex, 1, _("POP Before SMTP auth using a non-pop source"));
return NULL;
}
return (char *) haystack;
for (ptr = haystack; *(ptr + len - 1) != '\0'; ptr++)
- if (!strncasecmp (ptr, needle, len))
+ if (!g_ascii_strncasecmp (ptr, needle, len))
return (char *) ptr;
return NULL;
#include <stdlib.h>
#include <string.h>
-#include "camel-url.h"
#include "camel-exception.h"
+#include "camel-i18n.h"
#include "camel-mime-utils.h"
#include "camel-object.h"
#include "camel-string-utils.h"
-#include "camel-i18n.h"
+#include "camel-url.h"
static void copy_param (GQuark key_id, gpointer data, gpointer user_data);
static void output_param (GQuark key_id, gpointer data, gpointer user_data);
semi = strchr(url_string, ';');
if (semi && semi < colon &&
- !strncasecmp (semi, ";auth=", 6)) {
+ !g_ascii_strncasecmp (semi, ";auth=", 6)) {
url->authmech = g_strndup (semi + 6,
colon - semi - 6);
camel_url_decode (url->authmech);