aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/rc/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/rc/exec.c')
-rw-r--r--src/cmd/rc/exec.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/cmd/rc/exec.c b/src/cmd/rc/exec.c
index 62375df..2bdaebd 100644
--- a/src/cmd/rc/exec.c
+++ b/src/cmd/rc/exec.c
@@ -712,6 +712,28 @@ Xgoto(void)
}
void
+Xmatch(void)
+{
+ Word *p;
+ Word *s;
+
+ for(p=runner->args->word; p; p=p->link){
+ for(s=runner->args->link->word; s; s=s->link){
+ if(match(s->str, p->str, 0))
+ goto match;
+ }
+ }
+nomatch:
+ runner->status = 0;
+ goto cleanup;
+match:
+ runner->status = 1;
+cleanup:
+ poplist();
+ poplist();
+}
+
+void
Xcase(void)
{
Word *p; // pattern