{
register int i;
register unsigned char *cp, *bp;
- unsigned char buf[16];
+ unsigned char buf[16]; /* for reserved sequence name */
convdir = 1;
cp = bp = str;
+
+ /* Handle an integer */
if (isdigit(*cp)) {
while (isdigit(*bp))
bp++;
*bp++ = '\0';
delimp = cp;
- if (!strcmp(buf, seq_first))
+ /* Which one of the reserved names is it? */
+ if (strcmp(buf, seq_first)==0) {
return (mp->hghmsg || !(mp->msgflags & ALLOW_BEYOND) ?
mp->lowmsg : BADMSG);
- if (!strcmp(buf, seq_last)) {
+ } else if (strcmp(buf, seq_last)==0) {
convdir = -1;
return (mp->hghmsg || !(mp->msgflags & ALLOW_BEYOND) ?
mp->hghmsg : BADMSG);
- }
- if (!strcmp(buf, seq_cur))
+ } else if (strcmp(buf, seq_cur)==0) {
return (mp->curmsg > 0 ? mp->curmsg : BADMSG);
- if (!strcmp(buf, seq_prev)) {
+ } else if (strcmp(buf, seq_prev)==0) {
convdir = -1;
- for (i = (mp->curmsg <= mp->hghmsg) ? mp->curmsg - 1 : mp->hghmsg;
- i >= mp->lowmsg; i--) {
+ for (i = (mp->curmsg <= mp->hghmsg) ?
+ mp->curmsg - 1 : mp->hghmsg;
+ i >= mp->lowmsg; i--) {
if (does_exist(mp, i))
return i;
}
return BADMSG;
- }
- if (!strcmp(buf, seq_next)) {
- for (i = (mp->curmsg >= mp->lowmsg) ? mp->curmsg + 1 : mp->lowmsg;
- i <= mp->hghmsg; i++) {
+ } else if (strcmp(buf, seq_next)==0) {
+ for (i = (mp->curmsg >= mp->lowmsg) ?
+ mp->curmsg + 1 : mp->lowmsg;
+ i <= mp->hghmsg; i++) {
if (does_exist(mp, i))
return i;
}
return BADMSG;
- }
- return BADLST;
+ } else {
+ return BADLST;
+ }
}
/*