summaryrefslogtreecommitdiffhomepage
path: root/env.cpp
blob: ff44ff3f6ff3d6abce0c8a8924acf4c1867ee19b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "env.h"

#include <cstdlib>

std::string env_value(const std::string& key) {
 char* value_ptr{std::getenv(key.c_str())};
 if (value_ptr == nullptr) {
  return {};
 } else {
  return value_ptr;
 }
}