mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
updated for version 7.3.273
Problem: A BOM in an error file is seen as text. (Aleksey Baibarin) Solution: Remove the BOM from the text before evaluating. (idea by Christian Brabandt)
This commit is contained in:
21
src/mbyte.c
21
src/mbyte.c
@@ -837,6 +837,27 @@ bomb_size()
|
||||
return n;
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove all BOM from "s" by moving remaining text.
|
||||
*/
|
||||
void
|
||||
remove_bom(s)
|
||||
char_u *s;
|
||||
{
|
||||
if (enc_utf8)
|
||||
{
|
||||
char_u *p = s;
|
||||
|
||||
while ((p = vim_strbyte(p, 0xef)) != NULL)
|
||||
{
|
||||
if (p[1] == 0xbb && p[2] == 0xbf)
|
||||
STRMOVE(p, p + 3);
|
||||
else
|
||||
++p;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Get class of pointer:
|
||||
* 0 for blank or NUL
|
||||
|
Reference in New Issue
Block a user