about summary refs log tree commit diff
path: root/src/libexpr/common-opts.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-10-29T15·04+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-10-29T15·04+0000
commit4aced7f8d0d5d2c1057b0f46a70a37a577f81fa5 (patch)
tree1908294aa8f029be6bc4c0f227074391dbaeee9b /src/libexpr/common-opts.cc
parent8dadcede65c75488da4cc5e5d8266c4b176cb7e5 (diff)
parent26def5392f6f6364aa0939a2d4fc7705e786d38d (diff)
* Merge the GC branch.
Diffstat (limited to 'src/libexpr/common-opts.cc')
-rw-r--r--src/libexpr/common-opts.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libexpr/common-opts.cc b/src/libexpr/common-opts.cc
index 9131951e315d..c364aa9cb599 100644
--- a/src/libexpr/common-opts.cc
+++ b/src/libexpr/common-opts.cc
@@ -20,13 +20,17 @@ bool parseOptionArg(const string & arg, Strings::iterator & i,
     if (i == argsEnd) throw error;
     string value = *i++;
 
-    Value & v(autoArgs[state.symbols.create(name)].value);
+    /* !!! check for duplicates! */
+    Value * v = state.allocValue();
+    autoArgs.push_back(Attr(state.symbols.create(name), v));
 
     if (arg == "--arg")
-        state.mkThunk_(v, parseExprFromString(state, value, absPath(".")));
+        state.mkThunk_(*v, parseExprFromString(state, value, absPath(".")));
     else
-        mkString(v, value);
-    
+        mkString(*v, value);
+
+    autoArgs.sort(); // !!! inefficient
+
     return true;
 }