summaryrefslogtreecommitdiffstats
path: root/bin/sh/var.h
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2011-01-01 13:26:18 +0000
committerjilles <jilles@FreeBSD.org>2011-01-01 13:26:18 +0000
commit939106871155409dce420e35c6794821dd375a48 (patch)
tree9ba2056874948170151c7134c7d81e6ce37af27b /bin/sh/var.h
parent8229c0275d7cf8c5a2cd1e09ddcc3c74e9fafcfb (diff)
downloadFreeBSD-src-939106871155409dce420e35c6794821dd375a48.zip
FreeBSD-src-939106871155409dce420e35c6794821dd375a48.tar.gz
sh: Check readonly status for assignments on regular builtins.
An error message is written, the builtin is not executed, nonzero exit status is returned but the shell does not abort. This was already checked for special builtins and external commands, with the same consequences except that the shell aborts for special builtins. Obtained from: NetBSD
Diffstat (limited to 'bin/sh/var.h')
-rw-r--r--bin/sh/var.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/sh/var.h b/bin/sh/var.h
index 1ec707b..775db41 100644
--- a/bin/sh/var.h
+++ b/bin/sh/var.h
@@ -45,6 +45,7 @@
#define VSTACK 0x10 /* text is allocated on the stack */
#define VUNSET 0x20 /* the variable is not set */
#define VNOFUNC 0x40 /* don't call the callback function */
+#define VNOSET 0x80 /* do not set variable - just readonly test */
struct var {
@@ -106,7 +107,7 @@ void initvar(void);
void setvar(const char *, const char *, int);
void setvareq(char *, int);
struct strlist;
-void listsetvar(struct strlist *);
+void listsetvar(struct strlist *, int);
char *lookupvar(const char *);
char *bltinlookup(const char *, int);
void bltinsetlocale(void);
OpenPOWER on IntegriCloud