]> diplodocus.org Git - nmh/blobdiff - sbr/smatch.c
Remove msh(1).
[nmh] / sbr / smatch.c
index 1a104ada2228cc2c631432df1d77857483db41af..4d1d3d6814b7f977897a2dbd22819de3ee220788 100644 (file)
@@ -2,8 +2,6 @@
 /*
  * smatch.c -- match a switch (option)
  *
- * $Id$
- *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
  * complete copyright information.
@@ -31,16 +29,16 @@ smatch(char *string, struct swit *swp)
            continue;                   /* no match */
        for (sp = string; *sp == *tcp++;) {
            if (*sp++ == '\0')
-               return (tp - swp);      /* exact match */
+               return tp->swret;       /* exact match */
        }
        if (*sp) {
            if (*sp != ' ')
                continue;               /* no match */
            if (*--tcp == '\0')
-               return (tp - swp);      /* exact match */
+               return tp->swret;       /* exact match */
        }
        if (firstone == UNKWNSW)
-           firstone = tp - swp;
+           firstone = tp->swret;
        else
            firstone = AMBIGSW;
     }