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>2012-02-09T17·56+0100
committerEelco Dolstra <e.dolstra@tudelft.nl>2012-02-09T17·56+0100
commite9fc91df45c28376960a6e38c8c5f04bf9312623 (patch)
tree41d4bdad8e1783e7b8acff11b9b7353a9f16fe3f /src/libexpr/common-opts.cc
parentd5a5a83ad4fb8aba3b334039f567267a0463ee5a (diff)
Fix error message
This fixes the error message

  error: file `' was not found in the Nix search path (add it using $NIX_PATH or -I)
Diffstat (limited to 'src/libexpr/common-opts.cc')
-rw-r--r--src/libexpr/common-opts.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libexpr/common-opts.cc b/src/libexpr/common-opts.cc
index e0865d9fcc25..0ee889a995ef 100644
--- a/src/libexpr/common-opts.cc
+++ b/src/libexpr/common-opts.cc
@@ -47,9 +47,10 @@ bool parseSearchPathArg(const string & arg, Strings::iterator & i,
 Path lookupFileArg(EvalState & state, string s)
 {
     if (s.size() > 2 && s.at(0) == '<' && s.at(s.size() - 1) == '>') {
-        Path p = state.findFile(s.substr(1, s.size() - 2));
-        if (p == "") throw Error(format("file `%1%' was not found in the Nix search path (add it using $NIX_PATH or -I)") % p);
-        return p;
+        Path p = s.substr(1, s.size() - 2);
+        Path p2 = state.findFile(p);
+        if (p2 == "") throw Error(format("file `%1%' was not found in the Nix search path (add it using $NIX_PATH or -I)") % p);
+        return p2;
     } else
         return absPath(s);
 }