mirror of
https://github.com/debauchee/barrier.git
synced 2026-02-10 05:36:22 +08:00
Merge pull request #847 from chewi/getenv
Replace all instances of C's getenv with C++'s std::getenv
This commit is contained in:
@@ -61,7 +61,7 @@ execSelfNonDaemonized()
|
||||
}
|
||||
|
||||
bool alreadyDaemonized() {
|
||||
return getenv("_BARRIER_DAEMONIZED") != NULL;
|
||||
return std::getenv("_BARRIER_DAEMONIZED") != NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "../DataDirectories.h"
|
||||
|
||||
#include <unistd.h> // sysconf
|
||||
#include <stdlib.h> // getenv
|
||||
#include <cstdlib> // getenv
|
||||
#include <sys/types.h> // getpwuid(_r)
|
||||
#include <pwd.h> // getpwuid(_r)
|
||||
|
||||
@@ -63,7 +63,7 @@ static std::string profile_basedir()
|
||||
#ifdef WINAPI_XWINDOWS
|
||||
// linux/bsd adheres to freedesktop standards
|
||||
// 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)
|
||||
return dir;
|
||||
return unix_home() + "/.local/share";
|
||||
|
||||
@@ -877,7 +877,7 @@ XWindowsScreen::openDisplay(const char* displayName)
|
||||
{
|
||||
// get the DISPLAY
|
||||
if (displayName == NULL) {
|
||||
displayName = getenv("DISPLAY");
|
||||
displayName = std::getenv("DISPLAY");
|
||||
if (displayName == NULL) {
|
||||
displayName = ":0.0";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user