summaryrefslogtreecommitdiffstats
path: root/sysif.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-01-17 00:28:58 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-01-17 00:28:58 -0800
commitf3ed44bb461d0db6982076305787a67c3568d1f0 (patch)
tree1f382b7c574b567c9bce884b4e46b90d244950c2 /sysif.c
parent364e74f4b3fb403767509d3760c0cb00bdd46826 (diff)
downloadtxr-f3ed44bb461d0db6982076305787a67c3568d1f0.tar.gz
txr-f3ed44bb461d0db6982076305787a67c3568d1f0.tar.bz2
txr-f3ed44bb461d0db6982076305787a67c3568d1f0.zip
Bugfix: env-hash discarding characters after =.
* sysif.c (make_hash): Fix incorrect treatment of env values which contain equal signs, due to careless use of split_str.
Diffstat (limited to 'sysif.c')
-rw-r--r--sysif.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sysif.c b/sysif.c
index cd59cc64..18761e59 100644
--- a/sysif.c
+++ b/sysif.c
@@ -177,8 +177,11 @@ static val env_hash(void)
val hash = make_hash(nil, nil, t);
for (; env_strings; env_strings = cdr(env_strings)) {
- cons_bind (key, val_cons, split_str(car(env_strings), lit("=")));
- sethash(hash, key, car(val_cons));
+ val estr = car(env_strings);
+ val eqpos = break_str(estr, lit("="));
+ val key = sub(estr, 0, eqpos);
+ val val = sub(estr, succ(eqpos), t);
+ sethash(hash, key, val);
}
return hash;