Hi,

On 8/10/06, Bill McCarthy <[EMAIL PROTECTED]> wrote:
Hello Vim List,

The function reltimestr() return a string which may have
leading spaces.  Is that a bug or a feature?


The string returned by reltimestr() has leading spaces, because
the following code is internally used to generate this string (on
non MS-Windows systems):

   sprintf(buf, "%3ld.%06ld", (long)tm->tv_sec, (long)tm->tv_usec);

On MS-Windows, the following code is used:

   sprintf(buf, "%10.6lf", (double)tm->QuadPart / (double)fr.QuadPart);

- Yegappan


A workaround for this is:

function Reltimestr(t)
    return matchstr(reltimestr(a:t),'[0-9.]\+')
endfunction

Reply via email to