Add L10N comment to sort menu. Mark a couple strings for localization.
Use ascii_strncasecmp() for the X-Label header comparison.
Simplify label_message() using mutt library routines.
Bind label editing to "Y" instead of "y". "y" is already used in the
default sample muttrc to display mailboxes.
}
if (flags & CH_UPDATE_LABEL &&
- mutt_strncasecmp ("X-Label:", buf, 8) == 0)
+ ascii_strncasecmp ("X-Label:", buf, 8) == 0)
continue;
if (!ignore && fputs (buf, out) == EOF)
}
#endif
- if (flags & CH_UPDATE_LABEL && h->xlabel_changed)
+ if (flags & CH_UPDATE_LABEL)
{
h->xlabel_changed = 0;
if (h->env->x_label != NULL)
if (rc > 0) {
Context->changed = 1;
menu->redraw = REDRAW_FULL;
+ /* L10N: This is displayed when the x-label on one or more
+ * messages is edited. */
mutt_message (_("%d labels changed."), rc);
}
else {
+ /* L10N: This is displayed when editing an x-label, but no messages
+ * were updated. Possibly due to canceling at the prompt or if the new
+ * label is the same as the old label. */
mutt_message (_("No labels changed."));
}
break;
{
if (hdr == NULL)
return 0;
- if (hdr->env->x_label == NULL && new == NULL)
+ if (mutt_strcmp (hdr->env->x_label, new) == 0)
return 0;
- if (hdr->env->x_label != NULL && new != NULL &&
- strcmp(hdr->env->x_label, new) == 0)
- return 0;
- if (hdr->env->x_label != NULL)
- FREE(&hdr->env->x_label);
- if (new == NULL)
- hdr->env->x_label = NULL;
- else
- hdr->env->x_label = safe_strdup(new);
+ mutt_str_replace (&hdr->env->x_label, new);
return hdr->changed = hdr->xlabel_changed = 1;
}