0
0
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:
Bram Moolenaar
2011-08-10 13:21:46 +02:00
parent 213b10a57e
commit 836082d398
5 changed files with 32 additions and 1 deletions

View File

@@ -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