diff options
author | danlark <danlark@yandex-team.ru> | 2022-02-10 16:46:08 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:08 +0300 |
commit | 3426a9bc7f169ae9da54cef557ad2a33f6e8eee0 (patch) | |
tree | 26154e1e9990f1bb4525d3e3fb5b6dac2c2c1da2 /util/system/env.cpp | |
parent | cb68f224c46a8ee52ac3fdd2a32534b8bb8dc134 (diff) | |
download | ydb-3426a9bc7f169ae9da54cef557ad2a33f6e8eee0.tar.gz |
Restoring authorship annotation for <danlark@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/system/env.cpp')
-rw-r--r-- | util/system/env.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/util/system/env.cpp b/util/system/env.cpp index ead9b566a5..483b000d34 100644 --- a/util/system/env.cpp +++ b/util/system/env.cpp @@ -23,7 +23,7 @@ TString GetEnv(const TString& key, const TString& def) { #ifdef _win_ - size_t len = GetEnvironmentVariableA(key.data(), nullptr, 0); + size_t len = GetEnvironmentVariableA(key.data(), nullptr, 0); if (len == 0) { if (GetLastError() == ERROR_ENVVAR_NOT_FOUND) { @@ -36,7 +36,7 @@ TString GetEnv(const TString& key, const TString& def) { size_t bufferSize; do { bufferSize = buffer.size(); - len = GetEnvironmentVariableA(key.data(), buffer.data(), static_cast<DWORD>(bufferSize)); + len = GetEnvironmentVariableA(key.data(), buffer.data(), static_cast<DWORD>(bufferSize)); if (len > bufferSize) { buffer.resize(len); } @@ -44,7 +44,7 @@ TString GetEnv(const TString& key, const TString& def) { return TString(buffer.data(), len); #else - const char* env = getenv(key.data()); + const char* env = getenv(key.data()); return env ? TString(env) : def; #endif } @@ -53,12 +53,12 @@ void SetEnv(const TString& key, const TString& value) { bool isOk = false; int errorCode = 0; #ifdef _win_ - isOk = SetEnvironmentVariable(key.data(), value.data()); + isOk = SetEnvironmentVariable(key.data(), value.data()); if (!isOk) { errorCode = GetLastError(); } #else - isOk = (0 == setenv(key.data(), value.data(), true /*replace*/)); + isOk = (0 == setenv(key.data(), value.data(), true /*replace*/)); if (!isOk) { errorCode = errno; } |