mirror of
https://github.com/libretro/RetroArch
synced 2025-03-01 07:13:35 +00:00
Remove Windows \r line endings in glslang parser.
This commit is contained in:
parent
723741fc60
commit
3f344660c0
@ -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;
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <compat/strl.h>
|
||||
#include <string>
|
||||
#include <stdint.h>
|
||||
#include <algorithm>
|
||||
|
||||
#include "glslang_util.h"
|
||||
#include "slang_preprocess.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user