-
-/*
- * m_convert.c -- parse a message range or sequence and set SELECTED
+/* m_convert.c -- parse a message range or sequence and set SELECTED
*
* This code is Copyright (c) 2002, by the authors of nmh. See the
* COPYRIGHT file in the root directory of the nmh distribution for
cp = delimp;
if (*cp != '\0' && *cp != '-' && *cp != ':' && *cp != '=') {
badelim:
- advise (NULL, "illegal argument delimiter: `%c'(0%o)", *delimp, *delimp);
+ inform("illegal argument delimiter: `%c'(0%o)", *delimp, *delimp);
return 0;
}
badmsg:
switch (err) {
case BADMSG:
- advise (NULL, "no %s message", cp);
+ inform("no %s message", cp);
break;
case BADNUM:
- advise (NULL, "message %s doesn't exist", cp);
+ inform("message %s doesn't exist", cp);
break;
case BADRNG:
- advise (NULL, "message %s out of range 1-%d", cp, mp->hghmsg);
+ inform("message %s out of range 1-%d", cp, mp->hghmsg);
break;
case BADLST:
badlist:
- advise (NULL, "bad message list %s", name);
+ inform("bad message list %s", name);
break;
case BADNEW:
- advise (NULL, "folder full, no %s message", name);
+ inform("folder full, no %s message", name);
break;
default:
- advise (NULL, "no messages match specification");
+ inform("no messages match specification");
}
return 0;
}
goto badelim;
if (first > mp->hghmsg || last < mp->lowmsg) {
rangerr:
- advise (NULL, "no messages in range %s", name);
+ inform("no messages in range %s", name);
return 0;
}
}
} else { /* looking for the nth message. if not enough, fail. */
if (last < mp->lowmsg || last > mp->hghmsg) {
- advise (NULL, "no such message");
+ inform("no such message");
return 0;
}
first = last;
* limits simply reallocate the folder so it's within range.
*/
if (first < mp->lowoff || first > mp->hghoff)
- mp = folder_realloc(mp, first < mp->lowoff ? first : mp->lowoff,
- first > mp->hghoff ? first : mp->hghoff);
+ mp = folder_realloc(mp, min(first, mp->lowoff),
+ max(first, mp->hghoff));
set_select_empty (mp, first);
} else {
|| first < mp->lowmsg
|| !(does_exist (mp, first))) {
if (!strcmp (name, "cur") || !strcmp (name, "."))
- advise (NULL, "no %s message", name);
+ inform("no %s message", name);
else
- advise (NULL, "message %d doesn't exist", first);
+ inform("message %d doesn't exist", first);
return 0;
}
}
if (first || just_one)
return BADMSG;
- advise (NULL, "sequence %s %s", cp, inverted ? "full" : "empty");
+ inform("sequence %s %s", cp, inverted ? "full" : "empty");
return -1;
}