diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-07-18 21:43:02 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-07-18 21:43:02 +0000 |
commit | fe3ca8ddd9b85240387b6fa7934af3317e25b731 (patch) | |
tree | c855bb725bd10a5a00670bdd43218dfc17041832 | |
parent | b635633989f0ff5a5dbb564d65d332741f0e3e8d (diff) | |
download | vim-git-fe3ca8ddd9b85240387b6fa7934af3317e25b731.tar.gz |
updated for version 7.0109
-rw-r--r-- | runtime/syntax/javascript.vim | 4 | ||||
-rw-r--r-- | src/gui_w48.c | 10 | ||||
-rw-r--r-- | src/os_mswin.c | 13 | ||||
-rw-r--r-- | src/os_win32.c | 14 |
4 files changed, 15 insertions, 26 deletions
diff --git a/runtime/syntax/javascript.vim b/runtime/syntax/javascript.vim index c22aefa24..10bf4db75 100644 --- a/runtime/syntax/javascript.vim +++ b/runtime/syntax/javascript.vim @@ -2,7 +2,7 @@ " Language: JavaScript " Maintainer: Claudio Fleiner <claudio@fleiner.com> " URL: http://www.fleiner.com/vim/syntax/javascript.vim -" Last Change: 2004 Nov 20 +" Last Change: 2005 Jul 13 " For version 5.x: Clear all syntax items " For version 6.x: Quit when a syntax file was already loaded @@ -64,7 +64,7 @@ syn sync maxlines=100 " catch errors caused by wrong parenthesis syn region javaScriptParen transparent start="(" end=")" contains=javaScriptParen,javaScriptComment,javaScriptSpecial,javaScriptStringD,javaScriptStringS,javaScriptSpecialCharacter,javaScriptNumber,javaScriptRegexpString,javaScriptBoolean,javaScriptBraces,javaScriptFunction,javaScriptFunctionFold,javaScriptConditional,javaScriptRepeat,javaScriptBranch,javaScriptOperator,javaScriptType,javaScriptStatement,javaScriptBoolean,javaScriptConstant - syn region javaScriptParen transparent start="(" end=")" contains=javaScriptParen,javaScriptComment,javaScriptSpecial,javaScriptStringD,javaScriptStringS,javaScriptSpecialCharacter,javaScriptNumber,javaScriptRegexpString,javaScriptBoolean,javaScriptBraces +" syn region javaScriptParen transparent start="(" end=")" contains=javaScriptParen,javaScriptComment,javaScriptSpecial,javaScriptStringD,javaScriptStringS,javaScriptSpecialCharacter,javaScriptNumber,javaScriptRegexpString,javaScriptBoolean,javaScriptBraces syn match javaScrParenError ")" if main_syntax == "javascript" diff --git a/src/gui_w48.c b/src/gui_w48.c index 97a0ca00e..9a0247f4d 100644 --- a/src/gui_w48.c +++ b/src/gui_w48.c @@ -2194,9 +2194,8 @@ initialise_findrep(char_u *initial_string) s_findrep_struct.Flags |= FR_WHOLEWORD; if (entry_text != NULL && *entry_text != NUL) { - STRNCPY(s_findrep_struct.lpstrFindWhat, entry_text, - s_findrep_struct.wFindWhatLen); - s_findrep_struct.lpstrFindWhat[s_findrep_struct.wFindWhatLen - 1] = NUL; + vim_strncpy(s_findrep_struct.lpstrFindWhat, entry_text, + s_findrep_struct.wFindWhatLen - 1); s_findrep_struct.lpstrReplaceWith[0] = NUL; } vim_free(entry_text); @@ -3102,10 +3101,7 @@ gui_mch_browse( if (dflt == NULL) fileBuf[0] = NUL; else - { - STRNCPY(fileBuf, dflt, MAXPATHL - 1); - fileBuf[MAXPATHL - 1] = NUL; - } + vim_strncpy(fileBuf, dflt, MAXPATHL - 1); /* Convert the filter to Windows format. */ filterp = convert_filter(filter); diff --git a/src/os_mswin.c b/src/os_mswin.c index b0c137fca..6bffdb90b 100644 --- a/src/os_mswin.c +++ b/src/os_mswin.c @@ -410,8 +410,7 @@ mch_FullName( cname = ucs2_to_enc((short_u *)wbuf, NULL); if (cname != NULL) { - STRNCPY(buf, cname, len); - buf[len - 1] = NUL; + vim_strncpy(buf, cname, len - 1); nResult = OK; } } @@ -423,8 +422,8 @@ mch_FullName( { if (_fullpath(buf, fname, len - 1) == NULL) { - STRNCPY(buf, fname, len); /* failed, use relative path name */ - buf[len - 1] = NUL; + /* failed, use relative path name */ + vim_strncpy(buf, fname, len - 1); } else nResult = OK; @@ -493,8 +492,7 @@ vim_stat(const char *name, struct stat *stp) char buf[_MAX_PATH + 1]; char *p; - STRNCPY(buf, name, _MAX_PATH); - buf[_MAX_PATH] = NUL; + vim_strncpy(buf, name, _MAX_PATH); p = buf + strlen(buf); if (p > buf) mb_ptr_back(buf, p); @@ -1527,8 +1525,7 @@ clip_mch_set_selection(VimClipboard *cbd) if (lpszMem) { - STRNCPY(lpszMem, str, metadata.txtlen); - lpszMem[metadata.txtlen] = NUL; + vim_strncpy(lpszMem, str, metadata.txtlen); GlobalUnlock(hMem); } } diff --git a/src/os_win32.c b/src/os_win32.c index 6ad674e2d..c2d5ebbd7 100644 --- a/src/os_win32.c +++ b/src/os_win32.c @@ -2356,7 +2356,7 @@ mch_get_user_name( if (GetUserName(szUserName, &cch)) { - STRNCPY(s, szUserName, len); + vim_strncpy(s, szUserName, len - 1); return OK; } s[0] = NUL; @@ -2375,10 +2375,7 @@ mch_get_host_name( DWORD cch = len; if (!GetComputerName(s, &cch)) - { - STRNCPY(s, "PC (Win32 Vim)", len); - s[len - 1] = NUL; /* make sure it's terminated */ - } + vim_strncpy(s, "PC (Win32 Vim)", len - 1); } @@ -2418,8 +2415,7 @@ mch_dirname( if (p != NULL) { - STRNCPY(buf, p, len - 1); - buf[len - 1] = NUL; + vim_strncpy(buf, p, len - 1); vim_free(p); return OK; } @@ -2591,7 +2587,7 @@ mch_can_exe(char_u *name) /* * Loop over all extensions in $PATHEXT. */ - STRNCPY(buf, name, _MAX_PATH); + vim_strncpy(buf, name, _MAX_PATH - 1); p = mch_getenv("PATHEXT"); if (p == NULL) p = (char_u *)".com;.exe;.bat;.cmd"; @@ -4452,7 +4448,7 @@ mch_access(char *n, int p) char *pch; WIN32_FIND_DATA d; - STRNCPY(TempName, n, _MAX_PATH); + vim_strncpy(TempName, n, _MAX_PATH); pch = TempName + STRLEN(TempName) - 1; if (*pch != '\\' && *pch != '/') *++pch = '\\'; |