about summary refs log tree commit diff
path: root/third_party/nix/src/libstore/ssh.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/libstore/ssh.cc')
-rw-r--r--third_party/nix/src/libstore/ssh.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/third_party/nix/src/libstore/ssh.cc b/third_party/nix/src/libstore/ssh.cc
index 06aaf285f1..76c78b2fcd 100644
--- a/third_party/nix/src/libstore/ssh.cc
+++ b/third_party/nix/src/libstore/ssh.cc
@@ -2,6 +2,8 @@
 
 #include <utility>
 
+#include <absl/strings/match.h>
+
 namespace nix {
 
 SSHMaster::SSHMaster(const std::string& host, std::string keyFile,
@@ -12,7 +14,7 @@ SSHMaster::SSHMaster(const std::string& host, std::string keyFile,
       useMaster(useMaster && !fakeSSH),
       compress(compress),
       logFD(logFD) {
-  if (host.empty() || hasPrefix(host, "-")) {
+  if (host.empty() || absl::StartsWith(host, "-")) {
     throw Error("invalid SSH host name '%s'", host);
   }
 }