To: vim-dev@vim.org Subject: Patch 5.5.061 Fcc: outbox From: Bram Moolenaar ------------ Patch 5.5.061 Problem: When using "\:" in a modeline, the backslash is included in the option value. (Mohsin) Solution: Remove one backslash before the ':' in a modeline. Files: src/buffer.c, runtime/doc/options.txt *** ../vim-5.5.60/src/buffer.c Sat Dec 4 13:53:42 1999 --- src/buffer.c Tue Dec 7 12:13:06 1999 *************** *** 2555,2563 **** /* * Find end of set command: ':' or end of line. */ ! for (e = s; (*e != ':' || *(e - 1) == '\\') && *e != NUL; ++e) ! ; if (*e == NUL) end = TRUE; --- 2555,2565 ---- /* * Find end of set command: ':' or end of line. + * Skip over "\:", replacing it with ":". */ ! for (e = s; *e != ':' && *e != NUL; ++e) ! if (e[0] == '\\' && e[1] == ':') ! STRCPY(e, e + 1); if (*e == NUL) end = TRUE; *** ../vim-5.5.60/runtime/doc/options.txt Sat Dec 4 13:46:31 1999 --- runtime/doc/options.txt Tue Dec 7 12:45:16 1999 *************** *** 1,4 **** ! *options.txt* For Vim version 5.5. Last change: 1999 Dec 04 VIM REFERENCE MANUAL by Bram Moolenaar --- 1,4 ---- ! *options.txt* For Vim version 5.5. Last change: 1999 Dec 07 VIM REFERENCE MANUAL by Bram Moolenaar *************** *** 340,348 **** If an error is detected the rest of the line is skipped. ! If you want to include a ':' in a set command precede it with a '\'. No other ! commands than "set" are supported, for security reasons (somebody might create ! a Trojan horse text file with modelines). ============================================================================== 3. Saving settings *save-settings* --- 340,353 ---- If an error is detected the rest of the line is skipped. ! If you want to include a ':' in a set command precede it with a '\'. The ! backslash in front of the ':' will be removed. Example: ! > /* vi:set dir=c\:\tmp: */ ! This sets the 'dir' option to "c:\tmp". Only a single backslash before the ! ':' is removed. Thus to include "\:" you have to specify "\\:". ! ! No other commands than "set" are supported, for security reasons (somebody ! might create a Trojan horse text file with modelines). ============================================================================== 3. Saving settings *save-settings* *** ../vim-5.5.60/src/version.c Tue Dec 7 12:48:06 1999 --- src/version.c Tue Dec 7 12:45:37 1999 *************** *** 420,420 **** --- 420,421 ---- { /* Add new patch number below this line */ + 61, -- This is an airconditioned room, do not open Windows. --/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\-- \ \ www.vim.org/iccf www.moolenaar.net www.vim.org / /