X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fseq_read.c;h=bfecaf0184dd5bd557d07b57142bb2c2ecf03d54;hb=b33ba7a7953d06a123ee59811903f0eb7f69e120;hp=c1ac9fa72ad593e54e19f74df16a633f3ec8622f;hpb=3cc8ed080f6e741b8df04a3ebe764c659e75cb38;p=mmh diff --git a/sbr/seq_read.c b/sbr/seq_read.c index c1ac9fa..bfecaf0 100644 --- a/sbr/seq_read.c +++ b/sbr/seq_read.c @@ -132,11 +132,10 @@ seq_private(struct msgs *mp) plen = strlen(mp->foldpath) + 1; for (np = m_defs; np; np = np->n_next) { - if (isprefix("atr-", np->n_name) - && (j = strlen(np->n_name) - plen) > alen - && *(np->n_name + j) == '-' - && strcmp(mp->foldpath, np->n_name + j + 1) - == 0) { + if (strncmp(np->n_name, "atr-", alen)==0 && + (j = strlen(np->n_name) - plen) > alen && + *(np->n_name + j) == '-' && + strcmp(mp->foldpath, np->n_name + j + 1)==0) { cp = getcpy(np->n_name + alen); *(cp + j - alen) = '\0'; if ((i = seq_init(mp, cp, getcpy(np->n_field))) != -1) @@ -159,14 +158,15 @@ seq_private(struct msgs *mp) static int seq_init(struct msgs *mp, char *name, char *field) { - int i, j, k, is_current; + unsigned int i; + int j, k, is_current; char *cp, **ap; /* ** Check if this is the cur sequence, ** so we can do some special things. */ - is_current = !strcmp(seq_cur, name); + is_current = (strcmp(seq_cur, name)==0); /* ** Search for this sequence name to see if we've seen @@ -175,7 +175,7 @@ seq_init(struct msgs *mp, char *name, char *field) ** mesages in this folder. */ for (i = 0; mp->msgattrs[i]; i++) { - if (!strcmp(mp->msgattrs[i], name)) { + if (strcmp(mp->msgattrs[i], name)==0) { for (j = mp->lowmsg; j <= mp->hghmsg; j++) clear_sequence(mp, i, j); break;