about summary refs log tree commit diff
path: root/third_party/nix/src/libstore/ssh.cc
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-25T01·19+0100
committerVincent Ambo <tazjin@google.com>2020-05-25T01·19+0100
commitb99b368d17f2e806a61f7abb83c6d3a9e4bbdc38 (patch)
tree1f76047dd027421dcf79cdf4804fa5ff1bb08b2b /third_party/nix/src/libstore/ssh.cc
parent8cf1322a6fd5ae282d8a09fdba634f27a1a88560 (diff)
refactor(3p/nix/libutil): Replace hasPrefix/Suffix with Abseil r/845
Uses the equivalent absl::StartsWith and absl::EndsWith functions
instead.
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 06aaf285f1b5..76c78b2fcd77 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);
   }
 }