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-11-16T12·49+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-11-16T12·49+0000
commitfb9368b5a0b2457b28f19d4902bc0790123338a2 (patch)
tree8e0d68ccc2951c44cfd442b3dad261e190127013 /src/libexpr/common-opts.cc
parent64fd29855a8ae49cacdaff424679821b4fd3bf57 (diff)
parent4aced7f8d0d5d2c1057b0f46a70a37a577f81fa5 (diff)
* Sync with the trunk.
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;
 }