2007-09-19 [colin] 3.0.1cvs11
[claws.git] / src / common / utils.c
index dd1c2e01fae8a3b45f94c72b360c5200b67f9da4..0557dfc669dc505cbadb58bff5efdcd072694d50 100644 (file)
@@ -1723,7 +1723,7 @@ gint scan_mailto_url(const gchar *mailto, gchar **to, gchar **cc, gchar **bcc,
                        decode_uri(*attach, value);
                        for (; forbidden_uris[i]; i++) {
                                if (strstr(*attach, forbidden_uris[i])) {
-                                       printf("Refusing to attach '%s', potential private data leak\n",
+                                       g_print("Refusing to attach '%s', potential private data leak\n",
                                                        *attach);
                                        g_free(*attach);
                                        *attach = NULL;
@@ -3191,7 +3191,7 @@ gchar *generate_mime_boundary(const gchar *prefix)
                buf_uniq[i] = tbl[g_random_int_range(0, sizeof(tbl) - 1)];
        buf_uniq[i] = '\0';
 
-       return g_strdup_printf("%s_%s", prefix ? prefix : "MP",
+       return g_strdup_printf("%s_/%s", prefix ? prefix : "MP",
                               buf_uniq);
 }
 
@@ -3467,7 +3467,7 @@ gint execute_command_line(const gchar *cmdline, gboolean async)
        gchar **argv;
        gint ret;
 
-       debug_print("execute_command_line(): executing: %s\n", cmdline);
+       debug_print("execute_command_line(): executing: %s\n", cmdline?cmdline:"(null)");
 
        argv = strsplit_with_quote(cmdline, " ", 0);
 
@@ -3736,8 +3736,13 @@ void get_rfc822_date(gchar *buf, gint len)
        t = time(NULL);
        lt = localtime_r(&t, &buf1);
 
+#ifdef SOLARIS
+       sscanf(asctime_r(lt, buf2, sizeof(buf2)), "%3s %3s %d %d:%d:%d %d\n",
+              day, mon, &dd, &hh, &mm, &ss, &yyyy);
+#else
        sscanf(asctime_r(lt, buf2), "%3s %3s %d %d:%d:%d %d\n",
               day, mon, &dd, &hh, &mm, &ss, &yyyy);
+#endif
        g_snprintf(buf, len, "%s, %d %s %d %02d:%02d:%02d %s",
                   day, dd, mon, yyyy, hh, mm, ss, tzoffset(&t));
 }
@@ -3918,7 +3923,12 @@ gchar *generate_msgid(gchar *buf, gint len)
        t = time(NULL);
        lt = localtime_r(&t, &buft);
 
-       addr = g_strconcat("@", get_domain_name(), NULL);
+       if (strcmp(buf, "") == 0) {
+               addr = g_strconcat("@", get_domain_name(), NULL);
+       }
+       else {
+               addr = g_strconcat("@", buf, NULL);
+       }
 
        g_snprintf(buf, len, "%04d%02d%02d%02d%02d%02d.%08x%s",
                   lt->tm_year + 1900, lt->tm_mon + 1,
@@ -4558,7 +4568,7 @@ search_again:
 
        if (!result) return FALSE;
 
-       if (*ep_ && *(bp_ - 1) == '"' && *(ep_) == '"'
+       if (*ep_ && bp_ != start && *(bp_ - 1) == '"' && *(ep_) == '"'
        && *(ep_ + 1) == ' ' && *(ep_ + 2) == '<'
        && IS_RFC822_CHAR(*(ep_ + 3))) {
                /* this informative part with an @ in it is