]> diplodocus.org Git - nmh/blobdiff - sbr/m_convert.c
new.c: Order two return statements to match comment.
[nmh] / sbr / m_convert.c
index 3e9433b060ae52c92bfedc96fc518b978a26c21e..06e31afec898ef028dc114d455f4e75098f60cd3 100644 (file)
@@ -1,6 +1,4 @@
-
-/*
- * 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
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -204,8 +202,8 @@ single:
             * limits simply reallocate the folder so it's within range.
             */
            if (first < mp->lowoff || first > mp->hghoff)
             * 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 {
 
            set_select_empty (mp, first);
        } else {
@@ -295,16 +293,16 @@ m_conv (struct msgs *mp, char *str, int call)
     delimp = cp;
 
     if (!strcmp (buf, "first"))
     delimp = cp;
 
     if (!strcmp (buf, "first"))
-       return (mp->hghmsg || !(mp->msgflags & ALLOW_NEW)
-               ? mp->lowmsg : BADMSG);
+       return mp->hghmsg || !(mp->msgflags & ALLOW_NEW) ?
+            mp->lowmsg : BADMSG;
 
     if (!strcmp (buf, "last")) {
        convdir = -1;
 
     if (!strcmp (buf, "last")) {
        convdir = -1;
-       return (mp->hghmsg || !(mp->msgflags & ALLOW_NEW) ? mp->hghmsg : BADMSG);
+       return mp->hghmsg || !(mp->msgflags & ALLOW_NEW) ? mp->hghmsg : BADMSG;
     }
 
     if (!strcmp (buf, "cur") || !strcmp (buf, "."))
     }
 
     if (!strcmp (buf, "cur") || !strcmp (buf, "."))
-       return (mp->curmsg > 0 ? mp->curmsg : BADMSG);
+       return mp->curmsg > 0 ? mp->curmsg : BADMSG;
 
     if (!strcmp (buf, "prev")) {
        convdir = -1;
 
     if (!strcmp (buf, "prev")) {
        convdir = -1;
@@ -373,7 +371,7 @@ attr (struct msgs *mp, char *cp)
 
     convdir = 1;       /* convert direction */
 
 
     convdir = 1;       /* convert direction */
 
-    for (dp = cp; *dp && isalnum((unsigned char) *dp); dp++)
+    for (dp = cp; isalnum((unsigned char)*dp); dp++)
        continue;
 
     if (*dp == ':') {
        continue;
 
     if (*dp == ':') {