- if (mp->msgflags & ALLOW_NEW) {
- set_select_empty (mp, first);
- } else {
- if (first > mp->hghmsg
- || first < mp->lowmsg
- || !(does_exist (mp, first))) {
- if (!strcmp (name, "cur") || !strcmp (name, "."))
- advise (NULL, "no %s message", name);
- else
- advise (NULL, "message %d doesn't exist", first);
- return 0;
- }
- }
- last = first; /* range of 1 */
- }
-
- /*
- * Cycle through the range and select the messages
- * that exist. If ALLOW_NEW is set, then we also check
- * if we are selecting an empty slot.
- */
- for (; first <= last; first++) {
- if (does_exist (mp, first) ||
- ((mp->msgflags & ALLOW_NEW) && is_select_empty (mp, first))) {
- if (!is_selected (mp, first)) {
- set_selected (mp, first);
- mp->numsel++;
- if (mp->lowsel == 0 || first < mp->lowsel)
- mp->lowsel = first;
- if (first > mp->hghsel)
- mp->hghsel = first;
- }
- found++;
+ for (; first <= last; first++) {
+ if (does_exist (mp, first) ||
+ ((mp->msgflags & ALLOW_NEW) && is_select_empty (mp, first))) {
+ if (!is_selected (mp, first)) {
+ set_selected (mp, first);
+ mp->numsel++;
+ if (mp->lowsel == 0 || first < mp->lowsel)
+ mp->lowsel = first;
+ if (first > mp->hghsel)
+ mp->hghsel = first;
+ }
+ found++;
+ }