From 15afc2fa04e8f71796ae9081bd5139dde160179e Mon Sep 17 00:00:00 2001
From: Marc Weber <marco-oweber@gmx.de>
Date: Thu, 24 Sep 2009 18:22:33 +0000
Subject: [PATCH] fix mergeAttrsWithFunc (also merge in names which are only in
 the snd attrs)

svn path=/nixpkgs/trunk/; revision=17406
---
 pkgs/lib/misc.nix | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkgs/lib/misc.nix b/pkgs/lib/misc.nix
index f09ab33f721a..fc3bf2ce7cc1 100644
--- a/pkgs/lib/misc.nix
+++ b/pkgs/lib/misc.nix
@@ -264,7 +264,7 @@ rec {
     fold (n: set : if (__hasAttr n set) 
                         then setAttr set n (f (__getAttr n set) (__getAttr n set2))
                         else set )
-           set1 (__attrNames set2);
+           (set2 // set1) (__attrNames set2);
 
   # merging two attribute set concatenating the values of same attribute names
   # eg { a = 7; } {  a = [ 2 3 ]; } becomes { a = [ 7 2 3 ]; }