]>
diplodocus.org Git - nmh/blob - sbr/smatch.c
3 * smatch.c -- match a switch (option)
7 * This code is Copyright (c) 2002, by the authors of nmh. See the
8 * COPYRIGHT file in the root directory of the nmh distribution for
9 * complete copyright information.
16 smatch(char *string
, struct swit
*swp
)
28 for (tp
= swp
; tp
->sw
; tp
++) {
30 if (len
< abs(tp
->minchars
))
31 continue; /* no match */
32 for (sp
= string
; *sp
== *tcp
++;) {
34 return (tp
- swp
); /* exact match */
38 continue; /* no match */
40 return (tp
- swp
); /* exact match */
42 if (firstone
== UNKWNSW
)