about summary refs log tree commit diff
path: root/third_party/nix/src/nix/search.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/nix/search.cc')
-rw-r--r--third_party/nix/src/nix/search.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/third_party/nix/src/nix/search.cc b/third_party/nix/src/nix/search.cc
index 994fccd564..5978d197fe 100644
--- a/third_party/nix/src/nix/search.cc
+++ b/third_party/nix/src/nix/search.cc
@@ -251,13 +251,15 @@ struct CmdSearch : SourceExprCommand, MixJSON {
       }
 
       if (writeCache &&
-          rename(tmpFile.c_str(), jsonCacheFileName.c_str()) == -1)
+          rename(tmpFile.c_str(), jsonCacheFileName.c_str()) == -1) {
         throw SysError("cannot rename '%s' to '%s'", tmpFile,
                        jsonCacheFileName);
+      }
     }
 
-    if (results.size() == 0)
+    if (results.size() == 0) {
       throw Error("no results for the given search term(s)!");
+    }
 
     RunPager pager;
     for (auto el : results) {