Commit 1fadf5f9 1fadf5f958db3491727716d73f9bb4f274b45305 by Alain Magloire

* mail/util.c (util_expand_msglist): Cleanup the expand by pattern

	by moving some code in util_strupper(), the comparison must be
	case insensitive.
	(util_strupper): Convert the string to uppercase.
1 parent 6d71e8ea
2001-07-01 Alain Magloire
* mail/util.c (util_expand_msglist): Cleanup the expand by pattern
by moving some code in util_strupper(), the comparison must be
case insensitive.
(util_strupper): Convert the string to uppercase.
2001-07-01 Sergey Poznyakoff
* mailbox/attribute.c: set MU_ATTRIBUTE_MODIFIED bit in the underlying
structure when setting the flags.
......
......@@ -155,37 +155,30 @@ util_expand_msglist (const int argc, char **argv, int **list)
/* All messages with pattern following / in
the subject line, case insensitive */
int j;
char *pattern;
pattern = strdup (&argv[i][1]);
util_strupper (pattern);
for (j = 1; j <= total; j++)
{
message_t msg = NULL;
header_t hdr = NULL;
char *subject = NULL;
size_t subjlen;
char *pattern;
size_t patlen;
int k;
mailbox_get_message (mbox, j, &msg);
message_get_header (msg, &hdr);
header_aget_value (hdr, MU_HEADER_SUBJECT, &subject);
subjlen = (subject) ? strlen (subject) : 0;
for (k = 0; k < subjlen; k++)
subject[k] = toupper ((int)subject[k]);
pattern = strdup (&argv[i][1]);
patlen = (pattern) ? strlen (pattern) : 0;
for (k = 0; k < patlen; k++)
pattern[k] = toupper ((int)pattern[k]);
util_strupper (subject);
if (pattern && subject && strstr (subject, pattern))
{
current = util_ll_add (current, j);
}
free (pattern);
free (subject);
}
free (pattern);
}
else if (argv[i][0] == ':')
{
......@@ -700,6 +693,18 @@ util_strcat(char **dest, char *str)
}
}
/* Upper case the entire string. Assume it is NULL terminated. */
void
util_strupper (char *s)
{
if (s)
{
while (s++)
*s = toupper ((int)*s);
}
}
void
util_escape_percent (char **str)
{
......