*
* 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 2 of the License, or
+ * 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,
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
*/
#ifdef HAVE_CONFIG_H
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;
#endif
}
+#ifdef MAEMO
+const gchar *prefs_common_get_data_root(void);
+gchar *last_data_root = NULL;
+#endif
+
const gchar *get_news_cache_dir(void)
{
static gchar *news_cache_dir = NULL;
-
+#ifdef MAEMO
+ const gchar *data_root = prefs_common_get_data_root();
+ if (strcmp2(data_root, last_data_root)) {
+ g_free(news_cache_dir);
+ news_cache_dir = NULL;
+ }
+#endif
if (!news_cache_dir)
+#ifndef MAEMO
news_cache_dir = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
NEWS_CACHE_DIR, NULL);
-
+#else
+ {
+ if (data_root) {
+ news_cache_dir = g_strconcat(data_root, G_DIR_SEPARATOR_S,
+ "Claws", G_DIR_SEPARATOR_S,
+ g_get_user_name(), G_DIR_SEPARATOR_S,
+ NEWS_CACHE_DIR, NULL);
+ g_free(last_data_root);
+ last_data_root = g_strdup(last_data_root);
+ } else {
+ news_cache_dir = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
+ NEWS_CACHE_DIR, NULL);
+ g_free(last_data_root);
+ last_data_root = NULL;
+ }
+ }
+#endif
return news_cache_dir;
}
const gchar *get_imap_cache_dir(void)
{
static gchar *imap_cache_dir = NULL;
+#ifdef MAEMO
+ const gchar *data_root = prefs_common_get_data_root();
+ if (strcmp2(data_root, last_data_root)) {
+ g_free(imap_cache_dir);
+ imap_cache_dir = NULL;
+ }
+#endif
if (!imap_cache_dir)
+#ifndef MAEMO
imap_cache_dir = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
IMAP_CACHE_DIR, NULL);
+#else
+ {
+ if (data_root) {
+ imap_cache_dir = g_strconcat(data_root, G_DIR_SEPARATOR_S,
+ "Claws", G_DIR_SEPARATOR_S,
+ g_get_user_name(), G_DIR_SEPARATOR_S,
+ IMAP_CACHE_DIR, NULL);
+ g_free(last_data_root);
+ last_data_root = g_strdup(last_data_root);
+ } else {
+ imap_cache_dir = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
+ IMAP_CACHE_DIR, NULL);
+ g_free(last_data_root);
+ last_data_root = NULL;
+ }
+ }
+#endif
return imap_cache_dir;
}
const gchar *get_mbox_cache_dir(void)
{
static gchar *mbox_cache_dir = NULL;
-
+#ifdef MAEMO
+ const gchar *data_root = prefs_common_get_data_root();
+ if (strcmp2(data_root, last_data_root)) {
+ g_free(mbox_cache_dir);
+ mbox_cache_dir = NULL;
+ }
+#endif
if (!mbox_cache_dir)
+#ifndef MAEMO
mbox_cache_dir = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
MBOX_CACHE_DIR, NULL);
+#else
+ {
+ if (data_root) {
+ mbox_cache_dir = g_strconcat(data_root, G_DIR_SEPARATOR_S,
+ "Claws", G_DIR_SEPARATOR_S,
+ g_get_user_name(), G_DIR_SEPARATOR_S,
+ MBOX_CACHE_DIR, NULL);
+ g_free(last_data_root);
+ last_data_root = g_strdup(last_data_root);
+ } else {
+ mbox_cache_dir = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
+ MBOX_CACHE_DIR, NULL);
+ g_free(last_data_root);
+ last_data_root = NULL;
+ }
+ }
+#endif
return mbox_cache_dir;
}
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);
}
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);
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));
}
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,
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