X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/1691e80890e5d8ba258c51c214a3e91880e1db2b..b4f2851d4:/sbr/smatch.c?ds=sidebyside diff --git a/sbr/smatch.c b/sbr/smatch.c index 54ff550e..4d1d3d68 100644 --- a/sbr/smatch.c +++ b/sbr/smatch.c @@ -2,7 +2,9 @@ /* * 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. */ #include @@ -27,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; }