From 18c05b6d88d6700465d4308257dfe8968c7522cc Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Sat, 6 Oct 2007 21:18:58 +0800 Subject: [VAR] Remove setvarsafe The only user of setvarsafe is getopts. However, we can achieve the same result by pre-setting the value of shellparam.optind. --- src/var.c | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'src/var.c') diff --git a/src/var.c b/src/var.c index 3263dc5..501a279 100644 --- a/src/var.c +++ b/src/var.c @@ -167,31 +167,6 @@ initvar(void) vps1.text = "PS1=# "; } -/* - * Safe version of setvar, returns 1 on success 0 on failure. - */ - -int -setvarsafe(const char *name, const char *val, int flags) -{ - int err; - volatile int saveint; - struct jmploc *volatile savehandler = handler; - struct jmploc jmploc; - - SAVEINT(saveint); - if (setjmp(jmploc.loc)) - err = 1; - else { - handler = &jmploc; - setvar(name, val, flags); - err = 0; - } - handler = savehandler; - RESTOREINT(saveint); - return err; -} - /* * Set the value of a variable. The flags argument is ored with the * flags of the variable. If val is NULL, the variable is unset. -- cgit 1.4.1