about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/derivations.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc
index 3456a5f714a0..d0f836cab3d9 100644
--- a/src/libstore/derivations.cc
+++ b/src/libstore/derivations.cc
@@ -2,6 +2,7 @@
 #include "store-api.hh"
 #include "aterm.hh"
 #include "globals.hh"
+#include "util.hh"
 
 #include "derivations-ast.hh"
 #include "derivations-ast.cc"
@@ -163,9 +164,7 @@ ATerm unparseDerivation(const Derivation & drv)
 
 bool isDerivation(const string & fileName)
 {
-    return
-        fileName.size() >= drvExtension.size() &&
-        string(fileName, fileName.size() - drvExtension.size()) == drvExtension;
+    return hasSuffix(fileName, drvExtension);
 }