To: vim-dev@vim.org Subject: Patch 6.2.514 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.514 Problem: When a highlight/syntax group name contains invalid characters there is no warning. Solution: Add an error for unprintable characters and a warning for other invalid characters. Files: src/syntax.c *** ../vim-6.2.513/src/syntax.c Mon Apr 19 20:26:43 2004 --- src/syntax.c Tue Apr 27 22:17:13 2004 *************** *** 7897,7905 **** */ static int syn_add_group(name) ! char_u *name; { ! /* TODO: check that the name is ASCII letters, digits and underscore. */ /* * First call for this growarray: init growing array. */ --- 7897,7923 ---- */ static int syn_add_group(name) ! char_u *name; { ! char_u *p; ! ! /* Check that the name is ASCII letters, digits and underscore. */ ! for (p = name; *p != NUL; ++p) ! { ! if (!vim_isprintc(*p)) ! { ! EMSG(_("E669: Unprintable character in group name")); ! return 0; ! } ! else if (!ASCII_ISALNUM(*p) && *p != '_') ! { ! /* This is an error, but since there previously was no check only ! * give a warning. */ ! MSG(_("W18: Invalid character in group name")); ! break; ! } ! } ! /* * First call for this growarray: init growing array. */ *** ../vim-6.2.513/src/version.c Wed Apr 28 19:42:38 2004 --- src/version.c Wed Apr 28 19:43:49 2004 *************** *** 639,640 **** --- 639,642 ---- { /* Add new patch number below this line */ + /**/ + 514, /**/ -- hundred-and-one symptoms of being an internet addict: 46. Your wife makes a new rule: "The computer cannot come to bed." /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///