Bug#788055: netrwPlugin.vim: negative file size displayed

James McCoy jamessan at debian.org
Tue Jun 9 03:07:41 UTC 2015


Control: tag -1 confirmed upstream

On Mon, Jun 08, 2015 at 08:28:00AM +0200, Ph. Marek wrote:
> Given the file 
> 
>    -rw-r--r-- 1 . . 3276800000 Feb 16 15:09 2015-02-16-raspbian-wheezy.img
> 
> when looking at the directory in vim (via netrw) it gets displayed as
> 
>     2015-02-16-raspbian-wheezy.img           -2 Mon 16 Feb 2015 15:09:42 CET
> 
> which is really bad nowadays.

According to “:help getfsize()”

		If the size of {fname} is too big to fit in a Number then -2
		is returned.

and “:help Number” suggests that VimL numbers could be 64-bit

    Number		A 32 or 64 bit signed number.  |expr-number| *Number*

but in reality they aren't

    #if VIM_SIZEOF_INT <= 3		/* use long if int is smaller than 32 bits */
    typedef long	varnumber_T;
    #else
    typedef int	varnumber_T;
    #endif

Always using long for varnumber_T fixes the problem on 64-bit systems
and doesn't break any tests.  However, that won't help on 32-bit
systems and I doubt Bram will accept always using 64-bit.

There's a similar issue with the maximum number of lines that Vim can
handle in a file (c.f., https://bugs.launchpad.net/bugs/1374898) but the
naïve fix doesn't work very well.

Cheers,
-- 
James
GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy <jamessan at debian.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-vim-maintainers/attachments/20150608/3f3fc7d4/attachment.sig>


More information about the pkg-vim-maintainers mailing list