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