aboutsummaryrefslogtreecommitdiff
path: root/libsylph
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-03-27 08:19:53 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-03-27 08:19:53 +0000
commit1ad1a3e1721e99e8b2c055328e98297dc06dd907 (patch)
treee7646b8e4a458715d7e0b1a5a105ae9b532d0d09 /libsylph
parent505ab32fedc5de7984c2a4d1095d60dd292e0fd5 (diff)
fixed a bug that bold face was disabled with GLib 2.10 and Pango 1.12.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1058 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph')
-rw-r--r--libsylph/procheader.c4
-rw-r--r--libsylph/utils.c15
-rw-r--r--libsylph/utils.h3
3 files changed, 20 insertions, 2 deletions
diff --git a/libsylph/procheader.c b/libsylph/procheader.c
index cf9d481e..84c5f36d 100644
--- a/libsylph/procheader.c
+++ b/libsylph/procheader.c
@@ -687,19 +687,23 @@ MsgInfo *procheader_parse_stream(FILE *fp, MsgFlags flags, gboolean full)
if (from) {
msginfo->from = conv_unmime_header(from, charset);
+ subst_control(msginfo->from, ' ');
msginfo->fromname = procheader_get_fromname(msginfo->from);
g_free(from);
}
if (to) {
msginfo->to = conv_unmime_header(to, charset);
+ subst_control(msginfo->to, ' ');
g_free(to);
}
if (subject) {
msginfo->subject = conv_unmime_header(subject, charset);
+ subst_control(msginfo->subject, ' ');
g_free(subject);
}
if (cc) {
msginfo->cc = conv_unmime_header(cc, charset);
+ subst_control(msginfo->cc, ' ');
g_free(cc);
}
diff --git a/libsylph/utils.c b/libsylph/utils.c
index 914fd007..3cee525e 100644
--- a/libsylph/utils.c
+++ b/libsylph/utils.c
@@ -1079,7 +1079,7 @@ void subst_chars(gchar *str, gchar *orig, gchar subst)
while (*p) {
if (strchr(orig, *p) != NULL)
*p = subst;
- p++;
+ ++p;
}
}
@@ -1090,7 +1090,18 @@ void subst_null(gchar *str, gint len, gchar subst)
while (len--) {
if (*p == '\0')
*p = subst;
- p++;
+ ++p;
+ }
+}
+
+void subst_control(gchar *str, gchar subst)
+{
+ register gchar *p = str;
+
+ while (*p) {
+ if (g_ascii_iscntrl(*p))
+ *p = subst;
+ ++p;
}
}
diff --git a/libsylph/utils.h b/libsylph/utils.h
index 63bb7861..b8fe7051 100644
--- a/libsylph/utils.h
+++ b/libsylph/utils.h
@@ -296,6 +296,7 @@ GSList *newsgroup_list_append (GSList *group_list,
GList *add_history (GList *list,
const gchar *str);
+/* modify string */
void remove_return (gchar *str);
void remove_space (gchar *str);
void unfold_line (gchar *str);
@@ -308,6 +309,8 @@ void subst_chars (gchar *str,
void subst_null (gchar *str,
gint len,
gchar subst);
+void subst_control (gchar *str,
+ gchar subst);
void subst_for_filename (gchar *str);
gchar *get_alt_filename (const gchar *filename,