Fix Windows build break due to strchr losing const

Mingw32 headers and Apple libc++ both strip const from strchr.  Store
the result into a const char* to restore const to the pointer.
This commit is contained in:
Kp 2015-01-14 02:26:20 +00:00
parent 24bdbfb933
commit ea3c789f64

View file

@ -924,7 +924,11 @@ static int load_mission(const mle *mission)
break;
const auto &line = buf.line();
const auto lb = line.begin();
const auto t = strchr(lb, ',');
/* No auto: returned value must be type const char*
* Modern glibc maintains const-ness of the input.
* Apple libc++ and mingw32 do not.
*/
const char *const t = strchr(lb, ',');
if (!t)
break;
auto a = [](char c) {