projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
17fff17
)
compiler: Ignore byte-order-mark at start of file.
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Wed, 19 Sep 2012 15:51:16 +0000
(15:51 +0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Wed, 19 Sep 2012 15:51:16 +0000
(15:51 +0000)
From-SVN: r191485
gcc/go/gofrontend/lex.cc
patch
|
blob
|
history
diff --git
a/gcc/go/gofrontend/lex.cc
b/gcc/go/gofrontend/lex.cc
index 42d444b5fbc6a9b31ad459bac05241ddd1ef6d41..fa9db1f29aca1924f4e3b16aac2ebac0414d8c5c 100644
(file)
--- a/
gcc/go/gofrontend/lex.cc
+++ b/
gcc/go/gofrontend/lex.cc
@@
-722,7
+722,16
@@
Lex::next_token()
unsigned int ci;
bool issued_error;
this->lineoff_ = p - this->linebuf_;
- this->advance_one_utf8_char(p, &ci, &issued_error);
+ const char *pnext = this->advance_one_utf8_char(p, &ci,
+ &issued_error);
+
+ // Ignore byte order mark at start of file.
+ if (ci == 0xfeff && this->lineno_ == 1 && this->lineoff_ == 0)
+ {
+ p = pnext;
+ break;
+ }
+
if (Lex::is_unicode_letter(ci))
return this->gather_identifier();