From b99b368d17f2e806a61f7abb83c6d3a9e4bbdc38 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 25 May 2020 02:19:01 +0100 Subject: refactor(3p/nix/libutil): Replace hasPrefix/Suffix with Abseil Uses the equivalent absl::StartsWith and absl::EndsWith functions instead. --- third_party/nix/src/libstore/ssh.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'third_party/nix/src/libstore/ssh.cc') 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 +#include + 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); } } -- cgit 1.4.1