]>
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.
13 smatch(const char *string
, const struct swit
*swp
)
17 const struct swit
*tp
;
25 for (tp
= swp
; tp
->sw
; tp
++) {
27 if (len
< abs(tp
->minchars
))
28 continue; /* no match */
29 for (sp
= string
; *sp
== *tcp
++;) {
31 return tp
->swret
; /* exact match */
35 continue; /* no match */
37 return tp
->swret
; /* exact match */
39 if (firstone
== UNKWNSW
)