aboutsummaryrefslogtreecommitdiffstats
path: root/al
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-08-12 03:59:52 -0700
committerChris Robinson <[email protected]>2019-08-12 03:59:52 -0700
commit1aaf65abfecbde8548f90b1d0b0308b21bd0776d (patch)
tree767a9d1c72bd78ea572890286be92a866033f36e /al
parent50d16d2422febe2f4f56e7f29794778b10606b3a (diff)
Add methods to get env vars as an optional
Diffstat (limited to 'al')
-rw-r--r--al/state.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/al/state.cpp b/al/state.cpp
index 8c95c22f..884aa9d2 100644
--- a/al/state.cpp
+++ b/al/state.cpp
@@ -42,6 +42,7 @@
#include "event.h"
#include "inprogext.h"
#include "opthelpers.h"
+#include "strutils.h"
namespace {
@@ -73,8 +74,8 @@ constexpr ALchar alBSinc24Resampler[] = "23rd order Sinc";
extern "C" AL_API const ALchar* AL_APIENTRY alsoft_get_version(void)
START_API_FUNC
{
- const char *spoof{getenv("ALSOFT_SPOOF_VERSION")};
- if(spoof && spoof[0] != '\0') return spoof;
+ static const auto spoof = al::getenv("ALSOFT_SPOOF_VERSION");
+ if(spoof) return spoof->c_str();
return ALSOFT_VERSION;
}
END_API_FUNC