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