X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fseq_read.c;h=5707dae9643634f452dbeb4832814c933789e20b;hb=865335e03bab5e0ceb47a4d20564c3afb3de30c4;hp=26337c03729ed80190d22a30266ce0264c6dd655;hpb=5b792c4424571f05bc2008e3109797d18d7d00d1;p=mmh diff --git a/sbr/seq_read.c b/sbr/seq_read.c index 26337c0..5707dae 100644 --- a/sbr/seq_read.c +++ b/sbr/seq_read.c @@ -29,9 +29,9 @@ seq_read(struct msgs *mp) { /* ** Initialize the list of sequence names. Go ahead and - ** add the "cur" sequence to the list of sequences. + ** add the cur sequence to the list of sequences. */ - mp->msgattrs[0] = getcpy(current); + mp->msgattrs[0] = getcpy(seq_cur); mp->msgattrs[1] = NULL; make_all_public(mp); /* initially, make all public */ @@ -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) @@ -163,10 +162,10 @@ seq_init(struct msgs *mp, char *name, char *field) char *cp, **ap; /* - ** Check if this is "cur" sequence, + ** Check if this is the cur sequence, ** so we can do some special things. */ - is_current = !strcmp(current, name); + is_current = (strcmp(seq_cur, name)==0); /* ** Search for this sequence name to see if we've seen @@ -175,7 +174,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; @@ -210,7 +209,7 @@ seq_init(struct msgs *mp, char *name, char *field) k = cp ? m_atoi(cp) : j; /* - ** Keep mp->curmsg and "cur" sequence in synch. Unlike + ** Keep mp->curmsg and cur sequence in sync. Unlike ** other sequences, this message doesn't need to exist. ** Think about the series of command (rmm; next) to ** understand why this can be the case. But if it does