changeset 5596:1098b7b6e147 v7.4.145

updated for version 7.4.145 Problem: getregtype() does not return zero for unknown register. Solution: Adjust documention: return empty string for unknown register. Check the register name to be valid. (Yukihiro Nakadaira)
author Bram Moolenaar <bram@vim.org>
date Tue, 14 Jan 2014 12:33:36 +0100
parents a056715b3e81
children ace2fb223261
files runtime/doc/eval.txt src/ops.c src/version.c
diffstat 3 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -3460,7 +3460,7 @@ getregtype([{regname}])					*getregtype(
 		    "v"			for |characterwise| text
 		    "V"			for |linewise| text
 		    "<CTRL-V>{width}"	for |blockwise-visual| text
-		    0			for an empty or unknown register
+		    ""			for an empty or unknown register
 		<CTRL-V> is one character with value 0x16.
 		If {regname} is not specified, |v:register| is used.
 
--- a/src/ops.c
+++ b/src/ops.c
@@ -6240,7 +6240,9 @@ get_reg_type(regname, reglen)
     regname = may_get_selection(regname);
 #endif
 
-    /* Should we check for a valid name? */
+    if (regname != NUL && !valid_yank_reg(regname, FALSE))
+        return MAUTO;
+
     get_yank_register(regname, FALSE);
 
     if (y_current->y_array != NULL)
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    145,
+/**/
     144,
 /**/
     143,