summary refs log tree commit diff
path: root/src/nix-env
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2007-09-18 14:01:14 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2007-09-18 14:01:14 +0000
commit27f57c901800c085ecc4667748b2c3a2485ee8cb (patch)
treeeae16405b4fd600a58d34ec0612ff03d8d92bd7a /src/nix-env
parentf3441e6122c3ce8f81576bfe79897a638c8f82e2 (diff)
downloadguix-27f57c901800c085ecc4667748b2c3a2485ee8cb.tar.gz
* Ignore dangling symlinks in ~/.nix-defexpr.
Diffstat (limited to 'src/nix-env')
-rw-r--r--src/nix-env/nix-env.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc
index ad5a1b0958..77f8a2a615 100644
--- a/src/nix-env/nix-env.cc
+++ b/src/nix-env/nix-env.cc
@@ -116,9 +116,14 @@ static void getAllExprs(EvalState & state,
 
     for (Strings::iterator i = names.begin(); i != names.end(); ++i) {
         Path path2 = path + "/" + *i;
+        
+        struct stat st;
+        if (stat(path2.c_str(), &st) == -1)
+            continue; // ignore dangling symlinks in ~/.nix-defexpr
+        
         if (isNixExpr(path2))
             attrs.set(toATerm(*i), makeAttrRHS(
-                parseExprFromFile(state, absPath(path2)), makeNoPos()));
+                    parseExprFromFile(state, absPath(path2)), makeNoPos()));
         else
             getAllExprs(state, path2, attrs);
     }