aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/ssh.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-11-22 16:06:44 +0100
committerEelco Dolstra <edolstra@gmail.com>2019-11-22 16:18:13 +0100
commitba87b08f8529e4d9f8c58d8c625152058ceadb75 (patch)
treec78196cbeb52273c3d5b99ff8dee314108940b9a /src/libstore/ssh.cc
parentfd900c45b5ff9c6dc7f3ec814eca4ad603720899 (diff)
getEnv(): Return std::optional
This allows distinguishing between an empty value and no value.
Diffstat (limited to 'src/libstore/ssh.cc')
-rw-r--r--src/libstore/ssh.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstore/ssh.cc b/src/libstore/ssh.cc
index 5e0e44935..ac3ccd63d 100644
--- a/src/libstore/ssh.cc
+++ b/src/libstore/ssh.cc
@@ -16,7 +16,7 @@ SSHMaster::SSHMaster(const std::string & host, const std::string & keyFile, bool
void SSHMaster::addCommonSSHOpts(Strings & args)
{
- for (auto & i : tokenizeString<Strings>(getEnv("NIX_SSHOPTS")))
+ for (auto & i : tokenizeString<Strings>(getEnv("NIX_SSHOPTS").value_or("")))
args.push_back(i);
if (!keyFile.empty())
args.insert(args.end(), {"-i", keyFile});