1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: A BOM in an error file is seen as text. (Aleksey Baibarin)
12 Solution: Remove the BOM from the text before evaluating. (idea by Christian
14 Files: src/quickfix.c, src/mbyte.c, src/proto/mbyte.pro,
18 *** ../vim-7.3.272/src/quickfix.c 2011-05-19 17:42:54.000000000 +0200
19 --- src/quickfix.c 2011-08-10 12:56:15.000000000 +0200
25 IObuff[CMDBUFFSIZE - 2] = NUL; /* for very long lines */
30 if ((efmp = vim_strrchr(IObuff, '\n')) != NULL)
33 *** ../vim-7.3.272/src/mbyte.c 2011-07-27 18:25:40.000000000 +0200
34 --- src/mbyte.c 2011-08-10 13:11:56.000000000 +0200
41 + * Remove all BOM from "s" by moving remaining text.
51 + while ((p = vim_strbyte(p, 0xef)) != NULL)
53 + if (p[1] == 0xbb && p[2] == 0xbf)
62 * Get class of pointer:
65 *** ../vim-7.3.272/src/proto/mbyte.pro 2011-07-07 15:08:53.000000000 +0200
66 --- src/proto/mbyte.pro 2011-08-10 12:50:44.000000000 +0200
70 int enc_canon_props __ARGS((char_u *name));
71 char_u *mb_init __ARGS((void));
72 int bomb_size __ARGS((void));
73 + void remove_bom __ARGS((char_u *s));
74 int mb_get_class __ARGS((char_u *p));
75 int dbcs_class __ARGS((unsigned lead, unsigned trail));
76 int latin_char2len __ARGS((int c));
77 *** ../vim-7.3.272/src/testdir/test10.in 2010-08-15 21:57:29.000000000 +0200
78 --- src/testdir/test10.in 2011-08-10 13:01:46.000000000 +0200
85 + :" Also test a BOM is ignored.
88 :/start of errorfile/,/end of errorfile/w! Xerrorfile
89 :/start of testfile/,/end of testfile/w! Xtestfile
95 "Xtestfile", line 4.12: 1506-045 (S) Undeclared identifier fd_set.
96 ! "Xtestfile", line 7 col 19; this is an error
97 gcc -c -DHAVE_CONFIsing-prototypes -I/usr/X11R6/include version.c
98 Xtestfile:13: parse error before `asd'
99 make: *** [vim] Error 1
103 "Xtestfile", line 4.12: 1506-045 (S) Undeclared identifier fd_set.
104 ! "Xtestfile", line 7 col 19; this is an error
105 gcc -c -DHAVE_CONFIsing-prototypes -I/usr/X11R6/include version.c
106 Xtestfile:13: parse error before `asd'
107 make: *** [vim] Error 1
108 *** ../vim-7.3.272/src/version.c 2011-08-10 12:38:02.000000000 +0200
109 --- src/version.c 2011-08-10 13:14:35.000000000 +0200
113 { /* Add new patch number below this line */
119 Compilation process failed successfully.
121 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
122 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
123 \\\ an exciting new programming language -- http://www.Zimbu.org ///
124 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///