changeset 1293:3ae106044109

updated for version 7.1-008
author vimboss
date Tue, 19 Jun 2007 15:19:55 +0000
parents 66e40876590b
children 042fa969dab1
files runtime/doc/eval.txt src/eval.c
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt*      For Vim version 7.1.  Last change: 2007 May 11
+*eval.txt*      For Vim version 7.1.  Last change: 2007 Jun 09
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -2824,6 +2824,8 @@ getfsize({fname})					*getfsize()*
 		given file {fname}.
 		If {fname} is a directory, 0 is returned.
 		If the file {fname} can't be found, -1 is returned.
+		If the size of {fname} is too big to fit in a Number then -2
+		is returned.
 
 getfontname([{name}])					*getfontname()*
 		Without an argument returns the name of the normal font being
--- a/src/eval.c
+++ b/src/eval.c
@@ -10136,7 +10136,13 @@ f_getfsize(argvars, rettv)
 	if (mch_isdir(fname))
 	    rettv->vval.v_number = 0;
 	else
+	{
 	    rettv->vval.v_number = (varnumber_T)st.st_size;
+
+	    /* non-perfect check for overflow */
+	    if ((off_t)rettv->vval.v_number != (off_t)st.st_size)
+		rettv->vval.v_number = -2;
+	}
     }
     else
 	  rettv->vval.v_number = -1;