+2005-08-03 [paul] 1.9.13cvs10
+
+ sync with main
+
+ * src/addr_compl.c
+ * src/compose.c
+ * src/main.c
+ * src/pop.c
+ * src/prefs_account.c
+ * src/procmime.c
+ * src/procmsg.c
+ * src/quote_fmt_parse.y
+ * src/textview.c
+ * src/common/quoted-printable.c
+ * src/common/utils.c
+ * src/common/utils.h
+ * src/common/xml.c
+ replaced incorrect locale-independent
+ ctype functions with GLib's. Corrected
+ signedness mismatch.
+ * src/headerview.c
+ headerview_create(): added spacing for vbox.
+ * src/gtk/about.c
+ set focus to the OK button.
+
2005-08-03 [colin] 1.9.13cvs9
* src/folderview.c
( cvs diff -u -r 1.87.2.13 -r 1.87.2.14 src/folder.h; ) > 1.9.13cvs7.patchset
( cvs diff -u -r 1.60.2.21 -r 1.60.2.22 src/addressbook.c; cvs diff -u -r 1.5.2.1 -r 1.5.2.2 src/addressitem.h; cvs diff -u -r 1.274.2.47 -r 1.274.2.48 src/mainwindow.c; ) > 1.9.13cvs8.patchset
( cvs diff -u -r 1.207.2.49 -r 1.207.2.50 src/folderview.c; ) > 1.9.13cvs9.patchset
+( cvs diff -u -r 1.27.2.11 -r 1.27.2.12 src/addr_compl.c; cvs diff -u -r 1.382.2.144 -r 1.382.2.145 src/compose.c; cvs diff -u -r 1.8.2.7 -r 1.8.2.8 src/headerview.c; cvs diff -u -r 1.115.2.47 -r 1.115.2.48 src/main.c; cvs diff -u -r 1.56.2.36 -r 1.56.2.37 src/pop.c; cvs diff -u -r 1.105.2.28 -r 1.105.2.29 src/prefs_account.c; cvs diff -u -r 1.49.2.51 -r 1.49.2.52 src/procmime.c; cvs diff -u -r 1.150.2.32 -r 1.150.2.33 src/procmsg.c; cvs diff -u -r 1.22.2.10 -r 1.22.2.11 src/quote_fmt_parse.y; cvs diff -u -r 1.96.2.66 -r 1.96.2.67 src/textview.c; cvs diff -u -r 1.3.2.2 -r 1.3.2.3 src/common/quoted-printable.c; cvs diff -u -r 1.36.2.37 -r 1.36.2.38 src/common/utils.c; cvs diff -u -r 1.20.2.19 -r 1.20.2.20 src/common/utils.h; cvs diff -u -r 1.1.4.8 -r 1.1.4.9 src/common/xml.c; cvs diff -u -r 1.4.2.14 -r 1.4.2.15 src/gtk/about.c; ) > 1.9.13cvs10.patchset
MICRO_VERSION=13
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=9
+EXTRA_VERSION=10
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
return NULL;
#define IS_VALID_CHAR(x) \
- (isalnum(x) || (x) == '"' || (x) == '<' || (((unsigned char)(x)) > 0x7f))
+ (g_ascii_isalnum(x) || (x) == '"' || (x) == '<' || (((unsigned char)(x)) > 0x7f))
/* now scan back until we hit a valid character */
for (; *p && !IS_VALID_CHAR(*p); p = g_utf8_next_char(p))
while (*inp != '\0') {
if (*inp == '=') {
if (inp[1] && inp[2] &&
- get_hex_value(outp, inp[1], inp[2]) == TRUE) {
+ get_hex_value((guchar *)outp, inp[1], inp[2])
+ == TRUE) {
inp += 3;
- } else if (inp[1] == '\0' || isspace((guchar)inp[1])) {
+ } else if (inp[1] == '\0' || g_ascii_isspace(inp[1])) {
/* soft line break */
break;
} else {
if (*inp == 0x20)
len++;
else if (*inp == '=' || *inp == '?' || *inp == '_' ||
- *inp < 32 || *inp > 127 || isspace(*inp))
+ *inp < 32 || *inp > 127 || g_ascii_isspace(*inp))
len += 3;
else
len++;
if (*inp == 0x20)
*outp++ = '_';
else if (*inp == '=' || *inp == '?' || *inp == '_' ||
- *inp < 32 || *inp > 127 || isspace(*inp)) {
+ *inp < 32 || *inp > 127 || g_ascii_isspace(*inp)) {
*outp++ = '=';
get_hex_str(outp, *inp);
outp += 2;
gboolean str_case_find_equal(const gchar *haystack, const gchar *needle)
{
- return strcasecmp(haystack, needle) == 0;
+ return g_ascii_strcasecmp(haystack, needle) == 0;
}
gint to_number(const gchar *nstr)
{
- register const guchar *p;
+ register const gchar *p;
if (*nstr == '\0') return -1;
for (p = nstr; *p != '\0'; p++)
- if (!isdigit(*p)) return -1;
+ if (!g_ascii_isdigit(*p)) return -1;
return atoi(nstr);
}
#if !HAVE_ISWALNUM
int iswalnum(wint_t wc)
{
- return isalnum((int)wc);
+ return g_ascii_isalnum((int)wc);
}
#endif
#if !HAVE_ISWSPACE
int iswspace(wint_t wc)
{
- return isspace((int)wc);
+ return g_ascii_isspace((int)wc);
}
#endif
}
/* Examine if next block is non-ASCII string */
-gboolean is_next_nonascii(const guchar *s)
+gboolean is_next_nonascii(const gchar *s)
{
- const guchar *p;
+ const gchar *p;
/* skip head space */
- for (p = s; *p != '\0' && isspace(*p); p++)
+ for (p = s; *p != '\0' && g_ascii_isspace(*p); p++)
;
- for (; *p != '\0' && !isspace(*p); p++) {
- if (*p > 127 || *p < 32)
+ for (; *p != '\0' && !g_ascii_isspace(*p); p++) {
+ if (*(guchar *)p > 127 || *(guchar *)p < 32)
return TRUE;
}
return FALSE;
}
-gint get_next_word_len(const guchar *s)
+gint get_next_word_len(const gchar *s)
{
gint len = 0;
- for (; *s != '\0' && !isspace(*s); s++, len++)
+ for (; *s != '\0' && !g_ascii_isspace(*s); s++, len++)
;
return len;
void trim_subject(gchar *str)
{
- register guchar *srcp;
+ register gchar *srcp;
gchar op, cl;
gint in_brace;
break;
}
}
- while (isspace(*srcp)) srcp++;
+ while (g_ascii_isspace(*srcp)) srcp++;
memmove(str, srcp, strlen(srcp) + 1);
}
void eliminate_parenthesis(gchar *str, gchar op, gchar cl)
{
- register guchar *srcp, *destp;
+ register gchar *srcp, *destp;
gint in_brace;
srcp = destp = str;
if (in_brace == 0)
break;
}
- while (isspace(*srcp)) srcp++;
+ while (g_ascii_isspace(*srcp)) srcp++;
memmove(destp, srcp, strlen(srcp) + 1);
}
}
void eliminate_quote(gchar *str, gchar quote_chr)
{
- register guchar *srcp, *destp;
+ register gchar *srcp, *destp;
srcp = destp = str;
while ((destp = strchr(destp, quote_chr))) {
if ((srcp = strchr(destp + 1, quote_chr))) {
srcp++;
- while (isspace(*srcp)) srcp++;
+ while (g_ascii_isspace(*srcp)) srcp++;
memmove(destp, srcp, strlen(srcp) + 1);
} else {
*destp = '\0';
void eliminate_address_comment(gchar *str)
{
- register guchar *srcp, *destp;
+ register gchar *srcp, *destp;
gint in_brace;
srcp = destp = str;
if (*srcp == '@') {
destp = srcp + 1;
} else {
- while (isspace(*srcp)) srcp++;
+ while (g_ascii_isspace(*srcp)) srcp++;
memmove(destp, srcp, strlen(srcp) + 1);
}
} else {
if (in_brace == 0)
break;
}
- while (isspace(*srcp)) srcp++;
+ while (g_ascii_isspace(*srcp)) srcp++;
memmove(destp, srcp, strlen(srcp) + 1);
}
}
void remove_space(gchar *str)
{
- register guchar *p = str;
+ register gchar *p = str;
register gint spc;
while (*p) {
spc = 0;
- while (isspace(*(p + spc)))
+ while (g_ascii_isspace(*(p + spc)))
spc++;
if (spc)
memmove(p, p + spc, strlen(p + spc) + 1);
void unfold_line(gchar *str)
{
- register guchar *p = str;
+ register gchar *p = str;
register gint spc;
while (*p) {
if (*p == '\n' || *p == '\r') {
*p++ = ' ';
spc = 0;
- while (isspace(*(p + spc)))
+ while (g_ascii_isspace(*(p + spc)))
spc++;
if (spc)
memmove(p, p + spc, strlen(p + spc) + 1);
return FALSE;
}
-gboolean is_ascii_str(const guchar *str)
+gboolean is_ascii_str(const gchar *str)
{
- g_return_val_if_fail(str, FALSE);
+ const guchar *p = (const guchar *)str;
- while (*str != '\0') {
- if (*str != '\t' && *str != ' ' &&
- *str != '\r' && *str != '\n' &&
- (*str < 32 || *str >= 127))
+ while (*p != '\0') {
+ if (*p != '\t' && *p != ' ' &&
+ *p != '\r' && *p != '\n' &&
+ (*p < 32 || *p >= 127))
return FALSE;
- str++;
+ p++;
}
return TRUE;
gint get_quote_level(const gchar *str, const gchar *quote_chars)
{
- const guchar *first_pos;
- const guchar *last_pos;
- const guchar *p = str;
+ const gchar *first_pos;
+ const gchar *last_pos;
+ const gchar *p = str;
gint quote_level = -1;
/* speed up line processing by only searching to the last '>' */
if ((first_pos = line_has_quote_char(str, quote_chars)) != NULL) {
/* skip a line if it contains a '<' before the initial '>' */
- if (memchr(str, '<', first_pos - (const guchar *)str) != NULL)
+ if (memchr(str, '<', first_pos - str) != NULL)
return -1;
last_pos = line_has_quote_char_last(first_pos, quote_chars);
} else
while (p <= last_pos) {
while (p < last_pos) {
- if (isspace(*p))
+ if (g_ascii_isspace(*p))
p++;
else
break;
if (strchr(quote_chars, *p))
quote_level++;
- else if (*p != '-' && !isspace(*p) && p <= last_pos) {
+ else if (*p != '-' && !g_ascii_isspace(*p) && p <= last_pos) {
/* any characters are allowed except '-' and space */
while (*p != '-'
&& !strchr(quote_chars, *p)
- && !isspace(*p)
+ && !g_ascii_isspace(*p)
&& p < last_pos)
p++;
if (strchr(quote_chars, *p))
n++;
str = s_cl + 1;
- while (*str && isspace(*(guchar *)str)) str++;
+ while (*str && g_ascii_isspace(*str)) str++;
if (*str != op) {
string_list = g_slist_prepend(string_list,
g_strdup(""));
while (p) {
if (*p != '#') {
- while (isspace(*p)) p++;
+ while (g_ascii_isspace(*p)) p++;
if (!strncmp(p, "file:", 5)) {
q = p;
q += 5;
if (q > p) {
gchar *file, *locale_file = NULL;
q--;
- while (q > p && isspace(*q)) q--;
+ while (q > p && g_ascii_isspace(*q))
+ q--;
Xalloca(escaped_utf8uri, q - p + 2,
return result);
Xalloca(file, q - p + 2,
gchar *file_read_stream_to_str(FILE *fp)
{
GByteArray *array;
- gchar buf[BUFSIZ];
+ guchar buf[BUFSIZ];
gint n_read;
gchar *str;
const wchar_t *needle);
gint get_mbs_len (const gchar *s);
-gboolean is_next_nonascii (const guchar *s);
-gint get_next_word_len (const guchar *s);
+gboolean is_next_nonascii (const gchar *s);
+gint get_next_word_len (const gchar *s);
/* functions for string parsing */
gint subject_compare (const gchar *s1,
void subst_for_filename (gchar *str);
void subst_for_shellsafe_filename (gchar *str);
gboolean is_header_line (const gchar *str);
-gboolean is_ascii_str (const guchar *str);
+gboolean is_ascii_str (const gchar *str);
gint get_quote_level (const gchar *str,
const gchar *quote_chars);
gint check_line_length (const gchar *str,
gint xml_parse_next_tag(XMLFile *file)
{
gchar buf[XMLBUFSIZE];
- guchar *bufp = buf;
+ gchar *bufp = buf;
gchar *tag_str;
XMLTag *tag;
gint len;
return -1;
}
- while (*bufp != '\0' && !isspace(*bufp)) bufp++;
+ while (*bufp != '\0' && !g_ascii_isspace(*bufp)) bufp++;
if (*bufp == '\0') {
tag_str = conv_codeset_strdup(buf, file->encoding, CS_INTERNAL);
if (tag_str) {
gchar *p;
gchar quote;
- while (isspace(*bufp)) bufp++;
+ while (g_ascii_isspace(*bufp)) bufp++;
attr_name = bufp;
if ((p = strchr(attr_name, '=')) == NULL) {
g_warning("xml_parse_next_tag(): Syntax error in tag\n");
}
bufp = p;
*bufp++ = '\0';
- while (isspace(*bufp)) bufp++;
+ while (g_ascii_isspace(*bufp)) bufp++;
if (*bufp != '"' && *bufp != '\'') {
g_warning("xml_parse_next_tag(): Syntax error in tag\n");
gboolean can_break = FALSE;
gboolean do_break = FALSE;
gboolean was_white = FALSE;
- gboolean prev_hyphen = FALSE;
+ gboolean prev_dont_break = FALSE;
gtk_text_iter_forward_to_line_end(&line_end);
str = gtk_text_buffer_get_text(buffer, &iter, &line_end, FALSE);
gunichar wc;
gint uri_len;
- if (attr->is_line_break && can_break && was_white && !prev_hyphen)
+ if (attr->is_line_break && can_break && was_white && !prev_dont_break)
pos = i;
was_white = attr->is_white;
wc = g_utf8_get_char(p);
if (g_unichar_iswide(wc)) {
col += 2;
- if (prev_hyphen && can_break && attr->is_line_break)
+ if (prev_dont_break && can_break && attr->is_line_break)
pos = i;
} else if (*p == '\t')
col += 8;
break;
}
- if (*p == '-')
- prev_hyphen = TRUE;
+ if (*p == '-' || *p == '/')
+ prev_dont_break = TRUE;
else
- prev_hyphen = FALSE;
+ prev_dont_break = FALSE;
p = g_utf8_next_char(p);
can_break = TRUE;
NULL, NULL, NULL, NULL);
gtk_box_pack_end(GTK_BOX(vbox1), confirm_area, FALSE, FALSE, 4);
gtk_widget_grab_default(close_button);
+ gtk_widget_grab_focus(close_button);
g_signal_connect_closure
(G_OBJECT(close_button), "clicked",
g_cclosure_new_swap(G_CALLBACK(gtk_widget_hide_on_delete),
hbox = gtk_hbox_new(FALSE, 0);
gtk_container_set_border_width(GTK_CONTAINER(hbox), 2);
- vbox = gtk_vbox_new(FALSE, 0);
+ vbox = gtk_vbox_new(FALSE, 2);
gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0);
hbox1 = gtk_hbox_new(FALSE, 4);
subject_header_label = gtk_label_new(TR("Subject:"));
subject_body_label = gtk_label_new("");
+ gtk_label_set_selectable(GTK_LABEL(from_body_label), TRUE);
+ gtk_label_set_selectable(GTK_LABEL(to_body_label), TRUE);
+ gtk_label_set_selectable(GTK_LABEL(ng_body_label), TRUE);
+ gtk_label_set_selectable(GTK_LABEL(subject_body_label), TRUE);
+
+ GTK_WIDGET_UNSET_FLAGS(from_body_label, GTK_CAN_FOCUS);
+ GTK_WIDGET_UNSET_FLAGS(to_body_label, GTK_CAN_FOCUS);
+ GTK_WIDGET_UNSET_FLAGS(ng_body_label, GTK_CAN_FOCUS);
+ GTK_WIDGET_UNSET_FLAGS(subject_body_label, GTK_CAN_FOCUS);
+
gtk_box_pack_start(GTK_BOX(hbox1), from_header_label, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox1), from_body_label, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox1), to_header_label, FALSE, FALSE, 0);
gtk_misc_set_alignment(GTK_MISC(to_body_label), 0, 0.5);
gtk_misc_set_alignment(GTK_MISC(ng_body_label), 0, 0.5);
gtk_misc_set_alignment(GTK_MISC(subject_body_label), 0, 0.5);
-#if (GTK_MAJOR_VERSION > 2 || (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 6))
+#if GTK_CHECK_VERSION(2, 6, 0)
gtk_label_set_ellipsize(GTK_LABEL(to_body_label), PANGO_ELLIPSIZE_END);
gtk_label_set_ellipsize(GTK_LABEL(ng_body_label), PANGO_ELLIPSIZE_END);
gtk_label_set_ellipsize(GTK_LABEL(subject_body_label), PANGO_ELLIPSIZE_END);
MAKE_DIR_IF_NOT_EXIST(get_tmp_dir());
MAKE_DIR_IF_NOT_EXIST(RC_DIR G_DIR_SEPARATOR_S "uidl");
+ /* remove temporary files */
+ remove_all_files(get_tmp_dir());
+ remove_all_files(get_mime_tmp_dir());
+
+ if (is_file_exist(RC_DIR G_DIR_SEPARATOR_S "sylpheed.log")) {
+ if (rename(RC_DIR G_DIR_SEPARATOR_S "sylpheed.log",
+ RC_DIR G_DIR_SEPARATOR_S "sylpheed.log.bak") < 0)
+ FILE_OP_ERROR("sylpheed.log", "rename");
+ }
set_log_file(RC_DIR G_DIR_SEPARATOR_S "sylpheed.log");
folder_system_init();
{
Pop3Session *pop3_session = POP3_SESSION(session);
Pop3ErrorValue val = PS_SUCCESS;
- const guchar *body;
+ const gchar *body;
body = msg;
if (pop3_session->state != POP3_GETRANGE_UIDL_RECV &&
if (*body == '+' || *body == '-')
body++;
- while (isalpha(*body))
+ while (g_ascii_isalpha(*body))
body++;
- while (isspace(*body))
+ while (g_ascii_isspace(*body))
body++;
}
&compose.sigfile_radiobtn,
prefs_account_enum_set_data_from_radiobtn,
prefs_account_enum_set_radiobtn},
- {"signature_path", "~/"DEFAULT_SIGNATURE, &tmp_ac_prefs.sig_path, P_STRING,
- &compose.entry_sigpath,
+ {"signature_path", "~" G_DIR_SEPARATOR_S DEFAULT_SIGNATURE,
+ &tmp_ac_prefs.sig_path, P_STRING,
prefs_set_data_from_entry, prefs_set_entry},
{"auto_signature", "TRUE", &tmp_ac_prefs.auto_sig, P_BOOL,
void prefs_account_read_config(PrefsAccount *ac_prefs, const gchar *label)
{
- const guchar *p = label;
+ const gchar *p = label;
gchar *rcpath;
gint id;
gchar **strv, **cur;
g_free(rcpath);
*ac_prefs = tmp_ac_prefs;
- while (*p && !isdigit(*p)) p++;
+ while (*p && !g_ascii_isdigit(*p)) p++;
id = atoi(p);
if (id < 0) g_warning("wrong account id: %d\n", id);
ac_prefs->account_id = id;
GList *list = NULL;
FILE *fp;
gchar buf[BUFFSIZE];
- guchar *p;
+ gchar *p;
gchar *delim;
MimeType *mime_type;
gboolean fp_is_glob_file = TRUE;
p = buf;
if (fp_is_glob_file) {
- while (*p && !isspace(*p) && (*p!=':')) p++;
+ while (*p && !g_ascii_isspace(*p) && (*p!=':')) p++;
} else {
- while (*p && !isspace(*p)) p++;
+ while (*p && !g_ascii_isspace(*p)) p++;
}
if (*p) {
mime_type->sub_type = g_strdup(delim + 1);
if (fp_is_glob_file) {
- while (*p && (isspace(*p)||(*p=='*')||(*p=='.'))) p++;
+ while (*p && (g_ascii_isspace(*p)||(*p=='*')||(*p=='.'))) p++;
} else {
- while (*p && isspace(*p)) p++;
+ while (*p && g_ascii_isspace(*p)) p++;
}
if (*p)
SET_FILTER_KEY("header \"List-Id\"", H_LIST_ID);
extract_list_id_str(*key);
} else if (hentry[H_X_SEQUENCE].body != NULL) {
- guchar *p;
+ gchar *p;
SET_FILTER_KEY("X-Sequence", H_X_SEQUENCE);
p = *key;
while (*p != '\0') {
- while (*p != '\0' && !isspace(*p)) p++;
- while (isspace(*p)) p++;
- if (isdigit(*p)) {
+ while (*p != '\0' && !g_ascii_isspace(*p)) p++;
+ while (g_ascii_isspace(*p)) p++;
+ if (g_ascii_isdigit(*p)) {
*p = '\0';
break;
}
static int isseparator(int ch)
{
- return isspace(ch) || ch == '.' || ch == '-';
+ return g_ascii_isspace(ch) || ch == '.' || ch == '-';
}
static void quote_fmt_show_date(const MsgInfo *msginfo, const gchar *format)
(IS_ASCII(ch) && \
(ch) > 32 && \
(ch) != 127 && \
- !isspace(ch) && \
+ !g_ascii_isspace(ch) && \
!strchr("(),;<>\"", (ch)))
/* alphabet and number within 7bit ASCII */
-#define IS_ASCII_ALNUM(ch) (IS_ASCII(ch) && isalnum(ch))
+#define IS_ASCII_ALNUM(ch) (IS_ASCII(ch) && g_ascii_isalnum(ch))
#define IS_QUOTE(ch) ((ch) == '\'' || (ch) == '"')
static GHashTable *create_domain_tab(void)