This commit is contained in:
twinaphex 2018-11-08 22:34:05 +01:00
commit d7e7c94a17
2 changed files with 10 additions and 0 deletions

View File

@ -55,6 +55,15 @@ bool glslang_read_shader_file(const char *path, vector<string> *output, bool roo
return false;
}
/* Remove Windows \r chars if we encounter them.
* filestream_read_file() allocates one extra for 0 terminator. */
auto itr = remove_if(buf, buf + len + 1, [](char c) {
return c == '\r';
});
if (itr < buf + len)
*itr = '\0';
/* Cannot use string_split since it removes blank lines (strtok). */
ptr = buf;

View File

@ -7,6 +7,7 @@
#include <compat/strl.h>
#include <string>
#include <stdint.h>
#include <algorithm>
#include "glslang_util.h"
#include "slang_preprocess.h"