diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2012-05-25 15:18:43 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2012-05-25 15:18:43 +0300 |
commit | eec7101174a3b2807fb282272f75cc13d4b953c3 (patch) | |
tree | 2748f77fb510d32f6090fc3e3e02829682336e15 /gawkapi.c | |
parent | 577c3fc31a2718461fba2e599d162de96fe838fa (diff) | |
download | egawk-eec7101174a3b2807fb282272f75cc13d4b953c3.tar.gz egawk-eec7101174a3b2807fb282272f75cc13d4b953c3.tar.bz2 egawk-eec7101174a3b2807fb282272f75cc13d4b953c3.zip |
Additional changes / some cleanups.
Diffstat (limited to 'gawkapi.c')
-rw-r--r-- | gawkapi.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -255,13 +255,17 @@ node_to_awk_value(NODE *node, awk_value_t *val) /* * Lookup a variable, return its value. No messing with the value * returned. Return value is NULL if the variable doesn't exist. + * Built-in variables (except PROCINFO) may not be changed by an extension. */ static awk_value_t * api_sym_lookup(awk_ext_id_t id, const char *name, awk_value_t *result) { NODE *node; - if (name == NULL || (node = lookup(name)) == NULL) + if ( name == NULL + || *name == '\0' + || is_off_limits_var(name) /* most built-in vars not allowed */ + || (node = lookup(name)) == NULL) return NULL; return node_to_awk_value(node, result); |