Merge pull request #847 from chewi/getenv
Replace all instances of C's getenv with C++'s std::getenv
This commit is contained in:
commit
7dbfa63a63
|
@ -61,7 +61,7 @@ execSelfNonDaemonized()
|
||||||
}
|
}
|
||||||
|
|
||||||
bool alreadyDaemonized() {
|
bool alreadyDaemonized() {
|
||||||
return getenv("_BARRIER_DAEMONIZED") != NULL;
|
return std::getenv("_BARRIER_DAEMONIZED") != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#include "../DataDirectories.h"
|
#include "../DataDirectories.h"
|
||||||
|
|
||||||
#include <unistd.h> // sysconf
|
#include <unistd.h> // sysconf
|
||||||
#include <stdlib.h> // getenv
|
#include <cstdlib> // getenv
|
||||||
#include <sys/types.h> // getpwuid(_r)
|
#include <sys/types.h> // getpwuid(_r)
|
||||||
#include <pwd.h> // getpwuid(_r)
|
#include <pwd.h> // getpwuid(_r)
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ static std::string profile_basedir()
|
||||||
#ifdef WINAPI_XWINDOWS
|
#ifdef WINAPI_XWINDOWS
|
||||||
// linux/bsd adheres to freedesktop standards
|
// linux/bsd adheres to freedesktop standards
|
||||||
// https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
// https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||||
const char* dir = getenv("XDG_DATA_HOME");
|
const char* dir = std::getenv("XDG_DATA_HOME");
|
||||||
if (dir != NULL)
|
if (dir != NULL)
|
||||||
return dir;
|
return dir;
|
||||||
return unix_home() + "/.local/share";
|
return unix_home() + "/.local/share";
|
||||||
|
|
|
@ -877,7 +877,7 @@ XWindowsScreen::openDisplay(const char* displayName)
|
||||||
{
|
{
|
||||||
// get the DISPLAY
|
// get the DISPLAY
|
||||||
if (displayName == NULL) {
|
if (displayName == NULL) {
|
||||||
displayName = getenv("DISPLAY");
|
displayName = std::getenv("DISPLAY");
|
||||||
if (displayName == NULL) {
|
if (displayName == NULL) {
|
||||||
displayName = ":0.0";
|
displayName = ":0.0";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue