head 1.10; access; symbols OPENPKG_E1_MP_HEAD:1.7 OPENPKG_E1_MP:1.7 OPENPKG_E1_MP_2_STABLE:1.7 OPENPKG_E1_FP:1.7 OPENPKG_2_STABLE_MP:1.7 OPENPKG_2_STABLE_20061018:1.7 OPENPKG_2_STABLE_20060622:1.7 OPENPKG_2_STABLE:1.7.0.2 OPENPKG_2_STABLE_BP:1.7 OPENPKG_2_5_RELEASE:1.5.10.1 OPENPKG_2_5_SOLID:1.5.0.10 OPENPKG_2_5_SOLID_BP:1.5 OPENPKG_2_4_RELEASE:1.5 OPENPKG_2_4_SOLID:1.5.0.8 OPENPKG_2_4_SOLID_BP:1.5 OPENPKG_CW_FP:1.5 OPENPKG_2_3_RELEASE:1.5 OPENPKG_2_3_SOLID:1.5.0.6 OPENPKG_2_3_SOLID_BP:1.5 OPENPKG_2_2_RELEASE:1.5 OPENPKG_2_2_SOLID:1.5.0.4 OPENPKG_2_2_SOLID_BP:1.5 OPENPKG_2_1_RELEASE:1.5 OPENPKG_2_1_SOLID:1.5.0.2 OPENPKG_2_1_SOLID_BP:1.5 OPENPKG_2_0_RELEASE:1.3 OPENPKG_2_0_SOLID:1.3.0.2 OPENPKG_2_0_SOLID_BP:1.3 OPENPKG_1_1_SOLID:1.1.0.4 OPENPKG_1_0_SOLID:1.1.0.2; locks; strict; comment @# @; 1.10 date 2009.06.12.15.35.09; author rse; state Exp; branches; next 1.9; commitid l2YjuRrUrTJ65ARt; 1.9 date 2008.08.10.19.27.06; author rse; state Exp; branches; next 1.8; commitid 0HaCg8USvQ3vchet; 1.8 date 2007.05.12.18.15.59; author rse; state Exp; branches; next 1.7; commitid zqVIgtwNVkURsFhs; 1.7 date 2006.05.09.07.33.10; author rse; state Exp; branches; next 1.6; commitid 6M9am7zlEbiJJjwr; 1.6 date 2005.10.15.18.29.42; author rse; state Exp; branches; next 1.5; 1.5 date 2004.06.08.20.43.00; author rse; state Exp; branches 1.5.2.1 1.5.4.1 1.5.10.1; next 1.4; 1.4 date 2004.06.07.17.57.59; author rse; state Exp; branches; next 1.3; 1.3 date 2004.02.02.16.20.40; author rse; state Exp; branches; next 1.2; 1.2 date 2003.10.07.09.16.46; author rse; state Exp; branches; next 1.1; 1.1 date 2003.01.20.17.24.19; author thl; state dead; branches 1.1.2.1 1.1.4.1; next ; 1.5.2.1 date 2004.12.15.15.01.24; author thl; state Exp; branches; next ; 1.5.4.1 date 2004.12.15.15.00.53; author thl; state Exp; branches; next ; 1.5.10.1 date 2005.10.15.18.30.37; author rse; state Exp; branches; next ; 1.1.2.1 date 2003.01.20.17.24.19; author thl; state Exp; branches; next ; 1.1.4.1 date 2003.01.20.17.25.34; author thl; state Exp; branches; next ; desc @@ 1.10 log @add Scala language support @ text @The following patch adjust the RPM .spec syntax highlighting a little bit to better highlight OpenPKG RPM .spec files. Index: vim72/runtime/syntax/spec.vim --- vim72/runtime/syntax/spec.vim.orig 2005-01-04 10:46:51 +0100 +++ vim72/runtime/syntax/spec.vim 2007-05-12 20:11:23 +0200 @@@@ -83,7 +83,7 @@@@ "One line macros - valid in all ScriptAreas "tip: remember do include new items on specScriptArea's skip section -syn region specSectionMacroArea oneline matchgroup=specSectionMacro start='^%\(define\|patch\d*\|setup\|configure\|GNUconfigure\|find_lang\|makeinstall\|include\)\>' end='$' contains=specCommandOpts,specMacroIdentifier +syn region specSectionMacroArea oneline matchgroup=specSectionMacro start='^%\(option\|define\|undefine\|patch\d*\|setup\|configure\|GNUconfigure\|find_lang\|makeinstall\|include\)\>' end='$' contains=specCommandOpts,specMacroIdentifier syn region specSectionMacroBracketArea oneline matchgroup=specSectionMacro start='^%{\(configure\|GNUconfigure\|find_lang\|makeinstall\)}' end='$' contains=specCommandOpts,specMacroIdentifier "%% Files Section %% @@@@ -105,7 +105,7 @@@@ "%% PreAmble Section %% "Copyright and Serial were deprecated by License and Epoch syn region specPreAmbleDeprecated oneline matchgroup=specError start='^\(Copyright\|Serial\)' end='$' contains=specEmail,specURL,specURLMacro,specLicense,specColon,specVariables,specSpecialChar,specMacroIdentifier -syn region specPreAmble oneline matchgroup=specCommand start='^\(Prereq\|Summary\|Name\|Version\|Packager\|Requires\|Icon\|URL\|Source\d*\|Patch\d*\|Prefix\|Packager\|Group\|License\|Release\|BuildRoot\|Distribution\|Vendor\|Provides\|ExclusiveArch\|ExcludeArch\|ExclusiveOS\|Obsoletes\|BuildArch\|BuildArchitectures\|BuildRequires\|BuildConflicts\|BuildPreReq\|Conflicts\|AutoRequires\|AutoReq\|AutoReqProv\|AutoProv\|Epoch\)' end='$' contains=specEmail,specURL,specURLMacro,specLicense,specColon,specVariables,specSpecialChar,specMacroIdentifier +syn region specPreAmble oneline matchgroup=specCommand start='^\(Prereq\|Summary\|Name\|Version\|Packager\|Requires\|Icon\|URL\|Source\d*\|Patch\d*\|Prefix\|Packager\|Group\|License\|Release\|BuildRoot\|Distribution\|Class\|Vendor\|Provides\|ExclusiveArch\|ExcludeArch\|ExclusiveOS\|Obsoletes\|BuildArch\|BuildArchitectures\|BuildRequires\|BuildConflicts\|BuildPreReq\|Conflicts\|AutoRequires\|AutoReq\|AutoReqProv\|AutoProv\|Epoch\)' end='$' contains=specEmail,specURL,specURLMacro,specLicense,specColon,specVariables,specSpecialChar,specMacroIdentifier "%% Description Section %% syn region specDescriptionArea matchgroup=specSection start='^%description' end='^%'me=e-1 contains=specDescriptionOpts,specEmail,specURL,specNumber,specMacroIdentifier,specComment @@@@ -114,7 +114,7 @@@@ syn region specPackageArea matchgroup=specSection start='^%package' end='^%'me=e-1 contains=specPackageOpts,specPreAmble,specComment "%% Scripts Section %% -syn region specScriptArea matchgroup=specSection start='^%\(prep\|build\|install\|clean\|pre\|postun\|preun\|post\)\>' skip='^%{\|^%\(define\|patch\d*\|configure\|GNUconfigure\|setup\|find_lang\|makeinstall\)\>' end='^%'me=e-1 contains=specSpecialVariables,specVariables,@@specCommands,specVariables,shDo,shFor,shCaseEsac,specNoNumberHilite,specCommandOpts,shComment,shIf,specSpecialChar,specMacroIdentifier,specSectionMacroArea,specSectionMacroBracketArea,shOperator,shQuote1,shQuote2 +syn region specScriptArea matchgroup=specSection start='^%\(track\|prep\|build\|install\|check\|clean\|pre\|postun\|preun\|post\|test\)\>' skip='^%{\|^%\(option\|define\|patch\d*\|configure\|GNUconfigure\|setup\|find_lang\|makeinstall\)\>' end='^%'me=e-1 contains=specSpecialVariables,specVariables,@@specCommands,specVariables,shDo,shFor,shCaseEsac,specNoNumberHilite,specCommandOpts,shComment,shIf,specSpecialChar,specMacroIdentifier,specSectionMacroArea,specSectionMacroBracketArea,shOperator,shQuote1,shQuote2 "%% Changelog Section %% syn region specChangelogArea matchgroup=specSection start='^%changelog' end='^%'me=e-1 contains=specEmail,specURL,specWeekday,specMonth,specNumber,specComment,specLicense @@@@ -137,7 +137,7 @@@@ syn match shOperator contained '[><|!&;]\|[!=]=' syn region shDo transparent matchgroup=specBlock start="\" end="\" contains=ALLBUT,shFunction,shDoError,shCase,specPreAmble,@@specListedFiles -syn region specIf matchgroup=specBlock start="%ifosf\|%ifos\|%ifnos\|%ifarch\|%ifnarch\|%else" end='%endif' contains=ALLBUT, specIfError, shCase +syn region specIf matchgroup=specBlock start="%if\|%ifosf\|%ifos\|%ifnos\|%ifarch\|%ifnarch\|%else" end='%endif' contains=ALLBUT, specIfError, shCase syn region shIf transparent matchgroup=specBlock start="\" end="\" contains=ALLBUT,shFunction,shIfError,shCase,@@specListedFiles @@@@ -151,7 +151,7 @@@@ syn sync match shDoSync groupthere shDo "\" syn sync match shIfSync grouphere shIf "\" syn sync match shIfSync groupthere shIf "\" -syn sync match specIfSync grouphere specIf "%ifarch\|%ifos\|%ifnos" +syn sync match specIfSync grouphere specIf "%if\|%ifarch\|%ifos\|%ifnos" syn sync match specIfSync groupthere specIf "%endIf" syn sync match shForSync grouphere shFor "\" syn sync match shForSync groupthere shFor "\" ----------------------------------------------------------------------------- Scala Language Support https://lampsvn.epfl.ch/trac/scala/browser/scala-tool-support/trunk/src/vim Index: vim72/runtime/ftdetect/scala.vim --- /dev/null 2009-06-12 17:31:09 +0200 +++ vim72/runtime/ftdetect/scala.vim 2009-06-12 17:31:04 +0200 @@@@ -0,0 +1,3 @@@@ +" $URL: http://lampsvn.epfl.ch/svn-repos/scala/scala-tool-support/trunk/src/vim/ftdetect/scala.vim $ + +au BufRead,BufNewFile *.scala set filetype=scala Index: vim72/runtime/indent/scala.vim --- /dev/null 2009-06-12 17:31:09 +0200 +++ vim72/runtime/indent/scala.vim 2009-06-12 17:31:04 +0200 @@@@ -0,0 +1,85 @@@@ +" Vim indent file +" Language : Scala (http://scala-lang.org/) +" Maintainer : Stefan Matthias Aust +" Last Change: 2006 Apr 13 +" Revision : $Id: scala.vim 15234 2008-05-29 21:54:59Z stepancheg $ +" $URL: http://lampsvn.epfl.ch/svn-repos/scala/scala-tool-support/trunk/src/vim/indent/scala.vim $ + +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 + +setlocal indentexpr=GetScalaIndent() + +setlocal indentkeys=0{,0},0),!^F,<>>, + +setlocal autoindent sw=2 et + +if exists("*GetScalaIndent") + finish +endif + +function! CountParens(line) + let line = substitute(a:line, '"\(.\|\\"\)*"', '', 'g') + let open = substitute(line, '[^(]', '', 'g') + let close = substitute(line, '[^)]', '', 'g') + return strlen(open) - strlen(close) +endfunction + +function! GetScalaIndent() + " Find a non-blank line above the current line. + let lnum = prevnonblank(v:lnum - 1) + + " Hit the start of the file, use zero indent. + if lnum == 0 + return 0 + endif + + let ind = indent(lnum) + let prevline = getline(lnum) + + "Indent html literals + if prevline !~ '/>\s*$' && prevline =~ '^\s*<[a-zA-Z][^>]*>\s*$' + return ind + &shiftwidth + endif + + " Add a 'shiftwidth' after lines that start a block + " If if, for or while end with ), this is a one-line block + " If val, var, def end with =, this is a one-line block + if prevline =~ '^\s*\<\(\(else\s\+\)\?if\|for\|while\|va[lr]\|def\)\>.*[)=]\s*$' + \ || prevline =~ '^\s*\\s*$' + \ || prevline =~ '{\s*$' + let ind = ind + &shiftwidth + endif + + " If parenthesis are unbalanced, indent or dedent + let c = CountParens(prevline) + echo c + if c > 0 + let ind = ind + &shiftwidth + elseif c < 0 + let ind = ind - &shiftwidth + endif + + " Dedent after if, for, while and val, var, def without block + let pprevline = getline(prevnonblank(lnum - 1)) + if pprevline =~ '^\s*\<\(\(else\s\+\)\?if\|for\|while\|va[lr]\|def\)\>.*[)=]\s*$' + \ || pprevline =~ '^\s*\\s*$' + let ind = ind - &shiftwidth + endif + + " Align 'for' clauses nicely + if prevline =~ '^\s*\ (.*;\s*$' + let ind = ind - &shiftwidth + 5 + endif + + " Subtract a 'shiftwidth' on '}' or html + let thisline = getline(v:lnum) + if thisline =~ '^\s*[})]' + \ || thisline =~ '^\s*]*>' + let ind = ind - &shiftwidth + endif + + return ind +endfunction Index: vim72/runtime/syntax/scala.vim --- /dev/null 2009-06-12 17:31:09 +0200 +++ vim72/runtime/syntax/scala.vim 2009-06-12 17:31:04 +0200 @@@@ -0,0 +1,153 @@@@ +" Vim syntax file +" Language : Scala (http://scala-lang.org/) +" Maintainers: Stefan Matthias Aust, Julien Wetterwald +" Last Change: 2007 June 13 +" Revision : $Id: scala.vim 15234 2008-05-29 21:54:59Z stepancheg $ +" $URL: http://lampsvn.epfl.ch/svn-repos/scala/scala-tool-support/trunk/src/vim/syntax/scala.vim $ + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +syn case match +syn sync minlines=50 + +" most Scala keywords +syn keyword scalaKeyword abstract case catch do else extends final finally for forSome if implicit lazy match new null override private protected requires return sealed super this throw try type while with yield +syn match scalaKeyword "=>" +syn match scalaKeyword "<-" +syn match scalaKeyword "_" + +syn match scalaOperator ":\{2,\}" "this is not a type + +" package and import statements +syn keyword scalaPackage package nextgroup=scalaFqn skipwhite +syn keyword scalaImport import nextgroup=scalaFqn skipwhite +syn match scalaFqn "\<[._$a-zA-Z0-9,]*" contained nextgroup=scalaFqnSet +syn region scalaFqnSet start="{" end="}" contained + +" boolean literals +syn keyword scalaBoolean true false + +" definitions +syn keyword scalaDef def nextgroup=scalaDefName skipwhite +syn keyword scalaVal val nextgroup=scalaValName skipwhite +syn keyword scalaVar var nextgroup=scalaVarName skipwhite +syn keyword scalaClass class nextgroup=scalaClassName skipwhite +syn keyword scalaObject object nextgroup=scalaClassName skipwhite +syn keyword scalaTrait trait nextgroup=scalaClassName skipwhite +syn match scalaDefName "[^ =:;([]\+" contained nextgroup=scalaDefSpecializer skipwhite +syn match scalaValName "[^ =:;([]\+" contained +syn match scalaVarName "[^ =:;([]\+" contained +syn match scalaClassName "[^ =:;(\[]\+" contained nextgroup=scalaClassSpecializer skipwhite +syn region scalaDefSpecializer start="\[" end="\]" contained contains=scalaDefSpecializer +syn region scalaClassSpecializer start="\[" end="\]" contained contains=scalaClassSpecializer + +" type constructor (actually anything with an uppercase letter) +syn match scalaConstructor "\<[A-Z][_$a-zA-Z0-9]*\>" nextgroup=scalaConstructorSpecializer +syn region scalaConstructorSpecializer start="\[" end="\]" contained contains=scalaConstructorSpecializer + +" method call +syn match scalaRoot "\<[a-zA-Z][_$a-zA-Z0-9]*\."me=e-1 +syn match scalaMethodCall "\.[a-z][_$a-zA-Z0-9]*"ms=s+1 + +" type declarations in val/var/def +syn match scalaType ":\s*\(=>\s*\)\?[._$a-zA-Z0-9]\+\(\[[^]]*\]\+\)\?\(\s*\(<:\|>:\|#\|=>\)\s*[._$a-zA-Z0-9]\+\(\[[^]]*\]\+\)*\)*"ms=s+1 + +" comments +syn match scalaTodo "[tT][oO][dD][oO]" contained +syn match scalaLineComment "//.*" contains=scalaTodo +syn region scalaComment start="/\*" end="\*/" contains=scalaTodo +syn case ignore +syn include @@scalaHtml syntax/html.vim +unlet b:current_syntax +syn case match +syn region scalaDocComment start="/\*\*" end="\*/" contains=scalaDocTags,scalaTodo,@@scalaHtml keepend +syn region scalaDocTags start="{@@\(link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}" contained +syn match scalaDocTags "@@[a-z]\+" contained + +syn match scalaEmptyString "\"\"" + +" multi-line string literals +syn region scalaMultiLineString start="\"\"\"" end="\"\"\"" contains=scalaUnicode +syn match scalaUnicode "\\u[0-9a-fA-F]\{4}" contained + +" string literals with escapes +syn region scalaString start="\"[^"]" skip="\\\"" end="\"" contains=scalaStringEscape " TODO end \n or not? +syn match scalaStringEscape "\\u[0-9a-fA-F]\{4}" contained +syn match scalaStringEscape "\\[nrfvb\\\"]" contained + +" symbol and character literals +syn match scalaSymbol "'[_a-zA-Z0-9][_a-zA-Z0-9]*\>" +syn match scalaChar "'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'" + +" number literals +syn match scalaNumber "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>" +syn match scalaNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\=" +syn match scalaNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>" +syn match scalaNumber "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>" + +" xml literals +syn match scalaXmlTag "<[a-zA-Z]\_[^>]*/>" contains=scalaXmlQuote,scalaXmlEscape,scalaXmlString +syn region scalaXmlString start="\"" end="\"" contained +syn match scalaXmlStart "<[a-zA-Z]\_[^>]*>" contained contains=scalaXmlQuote,scalaXmlEscape,scalaXmlString +syn region scalaXml start="<\([a-zA-Z]\_[^>]*\_[^/]\|[a-zA-Z]\)>" matchgroup=scalaXmlStart end="]\+>" contains=scalaXmlEscape,scalaXmlQuote,scalaXml,scalaXmlStart,scalaXmlComment +syn region scalaXmlEscape matchgroup=scalaXmlEscapeSpecial start="{" matchgroup=scalaXmlEscapeSpecial end="}" contained contains=TOP +syn match scalaXmlQuote "&[^;]\+;" contained +syn match scalaXmlComment "" contained + +syn sync fromstart + +" map Scala groups to standard groups +hi link scalaKeyword Keyword +hi link scalaPackage Include +hi link scalaImport Include +hi link scalaBoolean Boolean +hi link scalaOperator Normal +hi link scalaNumber Number +hi link scalaEmptyString String +hi link scalaString String +hi link scalaChar String +hi link scalaMultiLineString String +hi link scalaStringEscape Special +hi link scalaSymbol Special +hi link scalaUnicode Special +hi link scalaComment Comment +hi link scalaLineComment Comment +hi link scalaDocComment Comment +hi link scalaDocTags Special +hi link scalaTodo Todo +hi link scalaType Type +hi link scalaTypeSpecializer scalaType +hi link scalaXml String +hi link scalaXmlTag Include +hi link scalaXmlString String +hi link scalaXmlStart Include +hi link scalaXmlEscape Normal +hi link scalaXmlEscapeSpecial Special +hi link scalaXmlQuote Special +hi link scalaXmlComment Comment +hi link scalaDef Keyword +hi link scalaVar Keyword +hi link scalaVal Keyword +hi link scalaClass Keyword +hi link scalaObject Keyword +hi link scalaTrait Keyword +hi link scalaDefName Function +hi link scalaDefSpecializer Function +hi link scalaClassName Special +hi link scalaClassSpecializer Special +hi link scalaConstructor Special +hi link scalaConstructorSpecializer scalaConstructor + +let b:current_syntax = "scala" + +" you might like to put these lines in your .vimrc +" +" customize colors a little bit (should be a different file) +" hi scalaNew gui=underline +" hi scalaMethodCall gui=italic +" hi scalaValName gui=underline +" hi scalaVarName gui=underline @ 1.9 log @upgrading package: vim 7.1.330 -> 7.2.0 @ text @d52 259 @ 1.8 log @upgrading package: vim 7.0.243 -> 7.1.0 @ text @d4 3 a6 3 Index: vim71/runtime/syntax/spec.vim --- vim71/runtime/syntax/spec.vim.orig 2005-01-04 10:46:51 +0100 +++ vim71/runtime/syntax/spec.vim 2007-05-12 20:11:23 +0200 @ 1.7 log @upgrade to the brand-new VIM 7 @ text @d4 3 a6 3 Index: vim70/runtime/syntax/spec.vim --- vim70/runtime/syntax/spec.vim.orig 2004-12-31 18:29:22 +0100 +++ vim70/runtime/syntax/spec.vim 2005-10-15 20:21:09 +0200 @ 1.6 log @upgrading package: vim 6.3.90 -> 6.4.0 @ text @d4 3 a6 3 Index: vim64/runtime/syntax/spec.vim --- vim64/runtime/syntax/spec.vim.orig 2004-12-31 18:29:22 +0100 +++ vim64/runtime/syntax/spec.vim 2005-10-15 20:21:09 +0200 @ 1.5 log @%undefine is also a valid construct @ text @d4 3 a6 3 Index: vim63/runtime/syntax/spec.vim --- vim63/runtime/syntax/spec.vim.orig 2003-05-11 20:20:37.000000000 +0200 +++ vim63/runtime/syntax/spec.vim 2004-02-02 16:43:25.000000000 +0100 d10 3 a12 3 "tip: remember do include new itens on specScriptArea's skip section -syn region specSectionMacroArea oneline matchgroup=specSectionMacro start='^%\(define\|patch\d*\|setup\|configure\|GNUconfigure\|find_lang\|makeinstall\)\>' end='$' contains=specCommandOpts,specMacroIdentifier +syn region specSectionMacroArea oneline matchgroup=specSectionMacro start='^%\(option\|define\|undefine\|patch\d*\|setup\|configure\|GNUconfigure\|find_lang\|makeinstall\)\>' end='$' contains=specCommandOpts,specMacroIdentifier @ 1.5.10.1 log @MFC: upgrade to bugfixed new version 6.4 @ text @d4 3 a6 3 Index: vim64/runtime/syntax/spec.vim --- vim64/runtime/syntax/spec.vim.orig 2004-12-31 18:29:22 +0100 +++ vim64/runtime/syntax/spec.vim 2005-10-15 20:21:09 +0200 d10 3 a12 3 "tip: remember do include new items on specScriptArea's skip section -syn region specSectionMacroArea oneline matchgroup=specSectionMacro start='^%\(define\|patch\d*\|setup\|configure\|GNUconfigure\|find_lang\|makeinstall\|include\)\>' end='$' contains=specCommandOpts,specMacroIdentifier +syn region specSectionMacroArea oneline matchgroup=specSectionMacro start='^%\(option\|define\|undefine\|patch\d*\|setup\|configure\|GNUconfigure\|find_lang\|makeinstall\|include\)\>' end='$' contains=specCommandOpts,specMacroIdentifier @ 1.5.2.1 log @2004.052-vim; CAN-2004-1138 @ text @a51 142 CAN-2004-1138, unified diff version of original patch with docs stripped Subject: Patch 6.3.045 From: Bram Moolenaar ------------ Problem: Unusual characters in an option value may cause unexpected behavior, especially for a modeline. (Ciaran McCreesh) Solution: Don't allow setting termcap options or 'printdevice' or 'titleold' in a modeline. Don't list options for "termcap" and "all" in a modeline. Don't allow unusual characters in 'filetype', 'syntax', 'backupext', 'keymap', 'patchmode' and 'langmenu'. Index: src/option.c --- vim63/src/option.c.orig 2004-05-15 12:20:06 +0200 +++ vim63/src/option.c 2004-12-15 15:33:49 +0100 @@@@ -293,6 +293,7 @@@@ #define P_SECURE 0x40000L/* cannot change in modeline or secure mode */ #define P_GETTEXT 0x80000L/* expand default value with _() */ #define P_NOGLOB 0x100000L/* do not use local value for global vimrc */ +#define P_NFNAME 0x200000L/* only normal file name chars allowed */ /* * options[] is initialized here. @@@@ -413,7 +414,7 @@@@ {"backupdir", "bdir", P_STRING|P_EXPAND|P_VI_DEF|P_COMMA|P_NODUP|P_SECURE, (char_u *)&p_bdir, PV_NONE, {(char_u *)DFLT_BDIR, (char_u *)0L}}, - {"backupext", "bex", P_STRING|P_VI_DEF, + {"backupext", "bex", P_STRING|P_VI_DEF|P_NFNAME, (char_u *)&p_bex, PV_NONE, { #ifdef VMS @@@@ -846,7 +847,7 @@@@ {"fileformats", "ffs", P_STRING|P_VIM|P_COMMA|P_NODUP, (char_u *)&p_ffs, PV_NONE, {(char_u *)DFLT_FFS_VI, (char_u *)DFLT_FFS_VIM}}, - {"filetype", "ft", P_STRING|P_ALLOCED|P_VI_DEF|P_NOGLOB, + {"filetype", "ft", P_STRING|P_ALLOCED|P_VI_DEF|P_NOGLOB|P_NFNAME, #ifdef FEAT_AUTOCMD (char_u *)&p_ft, PV_FT, {(char_u *)"", (char_u *)0L} @@@@ -1284,7 +1285,7 @@@@ {(char_u *)0L, (char_u *)0L} #endif }, - {"keymap", "kmp", P_STRING|P_ALLOCED|P_VI_DEF|P_RBUF|P_RSTAT, + {"keymap", "kmp", P_STRING|P_ALLOCED|P_VI_DEF|P_RBUF|P_RSTAT|P_NFNAME, #ifdef FEAT_KEYMAP (char_u *)&p_keymap, PV_KMAP, {(char_u *)"", (char_u *)0L} @@@@ -1330,7 +1331,7 @@@@ {(char_u *)NULL, #endif (char_u *)0L}}, - {"langmenu", "lm", P_STRING|P_VI_DEF, + {"langmenu", "lm", P_STRING|P_VI_DEF|P_NFNAME, #if defined(FEAT_MENU) && defined(FEAT_MULTI_LANG) (char_u *)&p_lm, PV_NONE, #else @@@@ -1562,7 +1563,7 @@@@ {(char_u *)0L, (char_u *)0L} #endif }, - {"patchmode", "pm", P_STRING|P_VI_DEF, + {"patchmode", "pm", P_STRING|P_VI_DEF|P_NFNAME, (char_u *)&p_pm, PV_NONE, {(char_u *)"", (char_u *)0L}}, {"path", "pa", P_STRING|P_EXPAND|P_VI_DEF|P_COMMA|P_NODUP, @@@@ -1595,7 +1596,7 @@@@ (char_u *)NULL, PV_NONE, #endif {(char_u *)FALSE, (char_u *)0L}}, - {"printdevice", "pdev", P_STRING|P_VI_DEF, + {"printdevice", "pdev", P_STRING|P_VI_DEF|P_SECURE, #ifdef FEAT_PRINTER (char_u *)&p_pdev, PV_NONE, {(char_u *)"", (char_u *)0L} @@@@ -1981,7 +1982,7 @@@@ {"switchbuf", "swb", P_STRING|P_VI_DEF|P_COMMA|P_NODUP, (char_u *)&p_swb, PV_NONE, {(char_u *)"", (char_u *)0L}}, - {"syntax", "syn", P_STRING|P_ALLOCED|P_VI_DEF|P_NOGLOB, + {"syntax", "syn", P_STRING|P_ALLOCED|P_VI_DEF|P_NOGLOB|P_NFNAME, #ifdef FEAT_SYN_HL (char_u *)&p_syn, PV_SYN, {(char_u *)"", (char_u *)0L} @@@@ -2086,7 +2087,7 @@@@ (char_u *)NULL, PV_NONE, #endif {(char_u *)85L, (char_u *)0L}}, - {"titleold", NULL, P_STRING|P_VI_DEF|P_GETTEXT, + {"titleold", NULL, P_STRING|P_VI_DEF|P_GETTEXT|P_SECURE, #ifdef FEAT_TITLE (char_u *)&p_titleold, PV_NONE, {(char_u *)N_("Thanks for flying Vim"), @@@@ -2321,7 +2322,7 @@@@ {(char_u *)0L, (char_u *)0L}}, /* terminal output codes */ -#define p_term(sss, vvv) {sss, NULL, P_STRING|P_VI_DEF|P_RALL, \ +#define p_term(sss, vvv) {sss, NULL, P_STRING|P_VI_DEF|P_RALL|P_SECURE, \ (char_u *)&vvv, PV_NONE, \ {(char_u *)"", (char_u *)0L}}, @@@@ -3302,7 +3303,8 @@@@ errmsg = NULL; startarg = arg; /* remember for error message */ - if (STRNCMP(arg, "all", 3) == 0 && !isalpha(arg[3])) + if (STRNCMP(arg, "all", 3) == 0 && !isalpha(arg[3]) + && !(opt_flags & OPT_MODELINE)) { /* * ":set all" show all options. @@@@ -3318,7 +3320,7 @@@@ else showoptions(1, opt_flags); } - else if (STRNCMP(arg, "termcap", 7) == 0) + else if (STRNCMP(arg, "termcap", 7) == 0 && !(opt_flags & OPT_MODELINE)) { showoptions(2, opt_flags); show_termcodes(); @@@@ -4604,6 +4606,15 @@@@ errmsg = e_secure; } + /* Check for a "normal" file name in some options. Disallow a path + * separator (slash and/or backslash), wildcards and characters that are + * often illegal in a file name. */ + else if ((options[opt_idx].flags & P_NFNAME) + && vim_strpbrk(*varp, "/\\*?[|<>") != NULL) + { + errmsg = e_invarg; + } + /* 'term' */ else if (varp == &T_NAME) { @ 1.5.4.1 log @2004.052-vim; CAN-2004-1138 @ text @a51 142 CAN-2004-1138, unified diff version of original patch with docs stripped Subject: Patch 6.3.045 From: Bram Moolenaar ------------ Problem: Unusual characters in an option value may cause unexpected behavior, especially for a modeline. (Ciaran McCreesh) Solution: Don't allow setting termcap options or 'printdevice' or 'titleold' in a modeline. Don't list options for "termcap" and "all" in a modeline. Don't allow unusual characters in 'filetype', 'syntax', 'backupext', 'keymap', 'patchmode' and 'langmenu'. Index: src/option.c --- vim63/src/option.c.orig 2004-05-15 12:20:06 +0200 +++ vim63/src/option.c 2004-12-15 15:33:49 +0100 @@@@ -293,6 +293,7 @@@@ #define P_SECURE 0x40000L/* cannot change in modeline or secure mode */ #define P_GETTEXT 0x80000L/* expand default value with _() */ #define P_NOGLOB 0x100000L/* do not use local value for global vimrc */ +#define P_NFNAME 0x200000L/* only normal file name chars allowed */ /* * options[] is initialized here. @@@@ -413,7 +414,7 @@@@ {"backupdir", "bdir", P_STRING|P_EXPAND|P_VI_DEF|P_COMMA|P_NODUP|P_SECURE, (char_u *)&p_bdir, PV_NONE, {(char_u *)DFLT_BDIR, (char_u *)0L}}, - {"backupext", "bex", P_STRING|P_VI_DEF, + {"backupext", "bex", P_STRING|P_VI_DEF|P_NFNAME, (char_u *)&p_bex, PV_NONE, { #ifdef VMS @@@@ -846,7 +847,7 @@@@ {"fileformats", "ffs", P_STRING|P_VIM|P_COMMA|P_NODUP, (char_u *)&p_ffs, PV_NONE, {(char_u *)DFLT_FFS_VI, (char_u *)DFLT_FFS_VIM}}, - {"filetype", "ft", P_STRING|P_ALLOCED|P_VI_DEF|P_NOGLOB, + {"filetype", "ft", P_STRING|P_ALLOCED|P_VI_DEF|P_NOGLOB|P_NFNAME, #ifdef FEAT_AUTOCMD (char_u *)&p_ft, PV_FT, {(char_u *)"", (char_u *)0L} @@@@ -1284,7 +1285,7 @@@@ {(char_u *)0L, (char_u *)0L} #endif }, - {"keymap", "kmp", P_STRING|P_ALLOCED|P_VI_DEF|P_RBUF|P_RSTAT, + {"keymap", "kmp", P_STRING|P_ALLOCED|P_VI_DEF|P_RBUF|P_RSTAT|P_NFNAME, #ifdef FEAT_KEYMAP (char_u *)&p_keymap, PV_KMAP, {(char_u *)"", (char_u *)0L} @@@@ -1330,7 +1331,7 @@@@ {(char_u *)NULL, #endif (char_u *)0L}}, - {"langmenu", "lm", P_STRING|P_VI_DEF, + {"langmenu", "lm", P_STRING|P_VI_DEF|P_NFNAME, #if defined(FEAT_MENU) && defined(FEAT_MULTI_LANG) (char_u *)&p_lm, PV_NONE, #else @@@@ -1562,7 +1563,7 @@@@ {(char_u *)0L, (char_u *)0L} #endif }, - {"patchmode", "pm", P_STRING|P_VI_DEF, + {"patchmode", "pm", P_STRING|P_VI_DEF|P_NFNAME, (char_u *)&p_pm, PV_NONE, {(char_u *)"", (char_u *)0L}}, {"path", "pa", P_STRING|P_EXPAND|P_VI_DEF|P_COMMA|P_NODUP, @@@@ -1595,7 +1596,7 @@@@ (char_u *)NULL, PV_NONE, #endif {(char_u *)FALSE, (char_u *)0L}}, - {"printdevice", "pdev", P_STRING|P_VI_DEF, + {"printdevice", "pdev", P_STRING|P_VI_DEF|P_SECURE, #ifdef FEAT_PRINTER (char_u *)&p_pdev, PV_NONE, {(char_u *)"", (char_u *)0L} @@@@ -1981,7 +1982,7 @@@@ {"switchbuf", "swb", P_STRING|P_VI_DEF|P_COMMA|P_NODUP, (char_u *)&p_swb, PV_NONE, {(char_u *)"", (char_u *)0L}}, - {"syntax", "syn", P_STRING|P_ALLOCED|P_VI_DEF|P_NOGLOB, + {"syntax", "syn", P_STRING|P_ALLOCED|P_VI_DEF|P_NOGLOB|P_NFNAME, #ifdef FEAT_SYN_HL (char_u *)&p_syn, PV_SYN, {(char_u *)"", (char_u *)0L} @@@@ -2086,7 +2087,7 @@@@ (char_u *)NULL, PV_NONE, #endif {(char_u *)85L, (char_u *)0L}}, - {"titleold", NULL, P_STRING|P_VI_DEF|P_GETTEXT, + {"titleold", NULL, P_STRING|P_VI_DEF|P_GETTEXT|P_SECURE, #ifdef FEAT_TITLE (char_u *)&p_titleold, PV_NONE, {(char_u *)N_("Thanks for flying Vim"), @@@@ -2321,7 +2322,7 @@@@ {(char_u *)0L, (char_u *)0L}}, /* terminal output codes */ -#define p_term(sss, vvv) {sss, NULL, P_STRING|P_VI_DEF|P_RALL, \ +#define p_term(sss, vvv) {sss, NULL, P_STRING|P_VI_DEF|P_RALL|P_SECURE, \ (char_u *)&vvv, PV_NONE, \ {(char_u *)"", (char_u *)0L}}, @@@@ -3302,7 +3303,8 @@@@ errmsg = NULL; startarg = arg; /* remember for error message */ - if (STRNCMP(arg, "all", 3) == 0 && !isalpha(arg[3])) + if (STRNCMP(arg, "all", 3) == 0 && !isalpha(arg[3]) + && !(opt_flags & OPT_MODELINE)) { /* * ":set all" show all options. @@@@ -3318,7 +3320,7 @@@@ else showoptions(1, opt_flags); } - else if (STRNCMP(arg, "termcap", 7) == 0) + else if (STRNCMP(arg, "termcap", 7) == 0 && !(opt_flags & OPT_MODELINE)) { showoptions(2, opt_flags); show_termcodes(); @@@@ -4604,6 +4606,15 @@@@ errmsg = e_secure; } + /* Check for a "normal" file name in some options. Disallow a path + * separator (slash and/or backslash), wildcards and characters that are + * often illegal in a file name. */ + else if ((options[opt_idx].flags & P_NFNAME) + && vim_strpbrk(*varp, "/\\*?[|<>") != NULL) + { + errmsg = e_invarg; + } + /* 'term' */ else if (varp == &T_NAME) { @ 1.4 log @upgrading package: vim 6.2.532 -> 6.3.0 @ text @d12 1 a12 1 +syn region specSectionMacroArea oneline matchgroup=specSectionMacro start='^%\(option\|define\|patch\d*\|setup\|configure\|GNUconfigure\|find_lang\|makeinstall\)\>' end='$' contains=specCommandOpts,specMacroIdentifier @ 1.3 log @visually recognize new RPM features @ text @d4 3 a6 3 Index: vim62/runtime/syntax/spec.vim --- vim62/runtime/syntax/spec.vim.orig 2003-05-11 20:20:37.000000000 +0200 +++ vim62/runtime/syntax/spec.vim 2004-02-02 16:43:25.000000000 +0100 @ 1.2 log @teach Vim about %option and %if @ text @d4 3 a6 2 --- vim62/runtime/syntax/spec.vim.orig Tue Oct 7 10:49:40 2003 +++ vim62/runtime/syntax/spec.vim Tue Oct 7 11:08:22 2003 d16 9 d30 1 a30 1 +syn region specScriptArea matchgroup=specSection start='^%\(prep\|build\|install\|clean\|pre\|postun\|preun\|post\)\>' skip='^%{\|^%\(option\|define\|patch\d*\|configure\|GNUconfigure\|setup\|find_lang\|makeinstall\)\>' end='^%'me=e-1 contains=specSpecialVariables,specVariables,@@specCommands,specVariables,shDo,shFor,shCaseEsac,specNoNumberHilite,specCommandOpts,shComment,shIf,specSpecialChar,specMacroIdentifier,specSectionMacroArea,specSectionMacroBracketArea,shOperator,shQuote1,shQuote2 @ 1.1 log @file vim.patch was initially added on branch OPENPKG_1_0_SOLID. @ text @d1 41 @ 1.1.4.1 log @apply backported security fix for CAN-2002-1377 @ text @a0 123 --- src/eval.c.orig Tue Mar 12 17:59:58 2002 +++ src/eval.c Mon Jan 20 16:20:46 2003 @@@@ -3280,6 +3280,9 @@@@ else retvar->var_val.var_string = NULL; + if (check_restricted() || check_secure()) + return; + #ifdef FEAT_LIBCALL /* The first two args must be strings, otherwise its meaningless */ if (argvars[0].var_type == VAR_STRING && argvars[1].var_type == VAR_STRING) @@@@ -3312,7 +3315,10 @@@@ VAR argvars; VAR retvar; { - retvar->var_val.var_number = mch_remove(get_var_string(&argvars[0])); + if (check_restricted() || check_secure()) + retvar->var_val.var_number = -1; + else + retvar->var_val.var_number = mch_remove(get_var_string(&argvars[0])); } /* @@@@ -4521,7 +4527,12 @@@@ int histype; char_u *str; char_u buf[NUMBUFLEN]; +#endif + retvar->var_val.var_number = FALSE; + if (check_restricted() || check_secure()) + return; +#ifdef FEAT_CMDHIST histype = get_histtype(get_var_string(&argvars[0])); if (histype >= 0) { @@@@ -4534,7 +4545,6 @@@@ } } #endif - retvar->var_val.var_number = FALSE; } /* @@@@ -5162,7 +5172,10 @@@@ { char_u buf[NUMBUFLEN]; - retvar->var_val.var_number = vim_rename(get_var_string(&argvars[0]), + if (check_restricted() || check_secure()) + retvar->var_val.var_number = -1; + else + retvar->var_val.var_number = vim_rename(get_var_string(&argvars[0]), get_var_string_buf(&argvars[1], buf)); } @@@@ -5442,6 +5455,8 @@@@ VAR varp; char_u nbuf[NUMBUFLEN]; + if (check_restricted() || check_secure()) + return; ++emsg_off; buf = get_buf_var(&argvars[0]); varname = get_var_string(&argvars[1]); @@@@ -5528,6 +5543,8 @@@@ VAR varp; char_u nbuf[NUMBUFLEN]; + if (check_restricted() || check_secure()) + return; ++emsg_off; win = find_win_by_nr(&argvars[0]); varname = get_var_string(&argvars[1]); @@@@ -5660,6 +5677,11 @@@@ var v; char_u *s; + if (check_restricted() || check_secure()) + { + retvar->var_val.var_number = -1; + return; + } # ifdef WIN32 int n = 0; @@@@ -5700,6 +5722,8 @@@@ char_u *r = NULL; #ifdef FEAT_CLIENTSERVER + if (!check_restricted() && !check_secure()) + { # ifdef WIN32 /* The server's HWND is encoded in the 'id' parameter */ int n = 0; @@@@ -5714,6 +5738,7 @@@@ serverStrToWin(get_var_string(&argvars[0])), &r, FALSE) < 0) # endif EMSG(_("E277: Unable to read a server reply")); + } #endif retvar->var_type = VAR_STRING; retvar->var_val.var_string = r; @@@@ -5731,6 +5756,8 @@@@ char_u *reply = get_var_string_buf(&argvars[1], buf); retvar->var_val.var_number = -1; + if (check_restricted() || check_secure()) + return; # ifndef WIN32 if (check_connection() == FAIL) return; @@@@ -5765,6 +5792,9 @@@@ # else Window w; # endif + + if (check_restricted() || check_secure()) + return; # ifdef FEAT_X11 if (check_connection() == FAIL) @ 1.1.2.1 log @apply backported security fix for CAN-2002-1377 @ text @a0 123 --- src/eval.c.orig Mon Jan 20 16:03:00 2003 +++ src/eval.c Mon Jan 20 16:23:44 2003 @@@@ -3178,6 +3178,9 @@@@ else retvar->var_val.var_string = NULL; + if (check_restricted() || check_secure()) + return; + #ifdef FEAT_LIBCALL /* The first two args must be strings, otherwise its meaningless */ if (argvars[0].var_type == VAR_STRING && argvars[1].var_type == VAR_STRING) @@@@ -3210,7 +3213,10 @@@@ VAR argvars; VAR retvar; { - retvar->var_val.var_number = mch_remove(get_var_string(&argvars[0])); + if (check_restricted() || check_secure()) + retvar->var_val.var_number = -1; + else + retvar->var_val.var_number = mch_remove(get_var_string(&argvars[0])); } /* @@@@ -4417,7 +4423,12 @@@@ int histype; char_u *str; char_u buf[NUMBUFLEN]; +#endif + retvar->var_val.var_number = FALSE; + if (check_restricted() || check_secure()) + return; +#ifdef FEAT_CMDHIST histype = get_histtype(get_var_string(&argvars[0])); if (histype >= 0) { @@@@ -4430,7 +4441,6 @@@@ } } #endif - retvar->var_val.var_number = FALSE; } /* @@@@ -5050,7 +5060,10 @@@@ { char_u buf[NUMBUFLEN]; - retvar->var_val.var_number = vim_rename(get_var_string(&argvars[0]), + if (check_restricted() || check_secure()) + retvar->var_val.var_number = -1; + else + retvar->var_val.var_number = vim_rename(get_var_string(&argvars[0]), get_var_string_buf(&argvars[1], buf)); } @@@@ -5330,6 +5343,8 @@@@ VAR varp; char_u nbuf[NUMBUFLEN]; + if (check_restricted() || check_secure()) + return; ++emsg_off; buf = get_buf_var(&argvars[0]); varname = get_var_string(&argvars[1]); @@@@ -5416,6 +5431,8 @@@@ VAR varp; char_u nbuf[NUMBUFLEN]; + if (check_restricted() || check_secure()) + return; ++emsg_off; win = find_win_by_nr(&argvars[0]); varname = get_var_string(&argvars[1]); @@@@ -5548,6 +5565,11 @@@@ var v; char_u *s; + if (check_restricted() || check_secure()) + { + retvar->var_val.var_number = -1; + return; + } # ifdef WIN32 int n = 0; @@@@ -5588,6 +5610,8 @@@@ char_u *r = NULL; #ifdef FEAT_CLIENTSERVER + if (!check_restricted() && !check_secure()) + { # ifdef WIN32 /* The server's HWND is encoded in the 'id' parameter */ int n = 0; @@@@ -5602,6 +5626,7 @@@@ serverStrToWin(get_var_string(&argvars[0])), &r, FALSE) < 0) # endif EMSG(_("E277: Unable to read a server reply")); + } #endif retvar->var_type = VAR_STRING; retvar->var_val.var_string = r; @@@@ -5619,6 +5644,8 @@@@ char_u *reply = get_var_string_buf(&argvars[1], buf); retvar->var_val.var_number = -1; + if (check_restricted() || check_secure()) + return; # ifndef WIN32 if (!check_connection()) return; @@@@ -5653,6 +5680,9 @@@@ # else Window w; # endif + + if (check_restricted() || check_secure()) + return; # ifdef FEAT_X11 if (!check_connection()) @