diff options
author | Nicholas Noll <nbnoll@eml.cc> | 2021-10-13 08:27:37 -0700 |
---|---|---|
committer | Nicholas Noll <nbnoll@eml.cc> | 2021-10-13 08:27:37 -0700 |
commit | d1a19f0d477a6249d8af9322317b8434b86260ea (patch) | |
tree | 59e49fc95018bb9d09e4a76a012f6f06ae345c67 /sys/cmd/rc/word.c | |
parent | 7d7af85919bbd352bb7dc0b5751b3684f8f0a8e4 (diff) |
fix(email): bytes error. updated vendoring
Diffstat (limited to 'sys/cmd/rc/word.c')
-rw-r--r-- | sys/cmd/rc/word.c | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/sys/cmd/rc/word.c b/sys/cmd/rc/word.c deleted file mode 100644 index 84ff40c..0000000 --- a/sys/cmd/rc/word.c +++ /dev/null @@ -1,64 +0,0 @@ -#include "rc.h" - -void -pushlist(void) -{ - List *ls; - - alloc(ls); - ls->words = nil; - ls->link = shell->stack, shell->stack = ls; -} - -void -freelist(Word *w) -{ - Word *it; - while (w) { - it = w->link; - efree(w->word); - efree(w); - w = it; - } -} - -void -poplist(void) -{ - List *ls = shell->stack; - if (!ls) - panicf("shell stack underflow"); - - freelist(ls->words); - shell->stack = ls->link; - efree(ls); -} - -int -count(Word *w) -{ - int n; - for (n=0; w; n++) - w = w->link; - return n; -} - -Word* -newword(char *w, Word *link) -{ - Word *wd; - - alloc(wd); - wd->word = strdup(w); - wd->link = link; - - return wd; -} - -void -pushword(char *w) -{ - if (shell->stack == nil) - panicf("no active stack"); - shell->stack->words = newword(w, shell->stack->words); -} |