mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-07 01:06:54 +08:00
Revert "Attempt to remedy the problem occuring on Clang."
This reverts commit 0e964da42658a4e7e5bebe281f2c125575f34246.
This commit is contained in:
parent
0e964da426
commit
42c355a8d0
@ -206,14 +206,14 @@ namespace chaiscript
|
|||||||
|
|
||||||
/// Skip BOM at the beginning of file
|
/// Skip BOM at the beginning of file
|
||||||
static bool skip_bom(std::ifstream &infile) {
|
static bool skip_bom(std::ifstream &infile) {
|
||||||
size_t bytes_needed = 3;
|
std::streamsize bytes_needed = 3;
|
||||||
|
std::streamsize bytes_read = 0;
|
||||||
char buffer[3];
|
char buffer[3];
|
||||||
|
|
||||||
memset(buffer, '\0', bytes_needed);
|
bytes_read = infile.readsome(buffer, bytes_needed);
|
||||||
|
|
||||||
infile.readsome(buffer, bytes_needed);
|
if (bytes_needed == bytes_read
|
||||||
|
&& (buffer[0] == '\xef')
|
||||||
if ((buffer[0] == '\xef')
|
|
||||||
&& (buffer[1] == '\xbb')
|
&& (buffer[1] == '\xbb')
|
||||||
&& (buffer[2] == '\xbf')) {
|
&& (buffer[2] == '\xbf')) {
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user