changeset 417:8f41fe56e2fc

updated for version 7.0109
author vimboss
date Mon, 18 Jul 2005 21:43:02 +0000
parents 3da34f87c760
children 84825cc6f049
files runtime/syntax/javascript.vim src/gui_w48.c src/os_mswin.c src/os_win32.c
diffstat 4 files changed, 15 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- 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"
--- a/src/gui_w48.c
+++ b/src/gui_w48.c
@@ -2194,9 +2194,8 @@ initialise_findrep(char_u *initial_strin
 	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);
--- 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 *
     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);
 	}
     }
--- 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 = '\\';