[cvsnt] re: history error?

capaverde at 3ia.com.br capaverde at 3ia.com.br
Tue May 31 14:00:19 BST 2005


Community technical support mailing list was retired 2010 and replaced with a professional technical support team. For assistance please contact: Pre-sales Technical support via email to sales@march-hare.com.


Zoltán

You are right. It seems that it was designed to correct the
"year 2038 bug". Under VC6 time_t is a 32 bit data type but
when you compile in VC7, it is defined as 64 bit! It's causing the
mistake in history file.
To fix my CVSNT 2.5.01.1927, I patched the file history.cpp,
line 860, to looks like:

    sprintf (line, "%c%08lx|%s|%s|%s|%s|%s\n",
	     type, (long)global_session_time_t,
	     username, workdir, repos, revs, name);

As it's the number of seconds since 1970, it should works for the
next 30 years.

Capaverde




> Hi!
> Some weeks ago I asked a question about history file sturcture error.
> Nobody react to it...
> I hacked a little the source since then.
>
> Some month ago, the history line looks like this:
> X date | user | CurDir | special | rev(s) | argument '\n'
> for example:
> M273b3463|dgg|~/work*9|usr/local/cvs/examples|1.2|loginfo
>
> but the now (for some cvsnt release) there is an additional (null) value
> inserted before the user field, and argument(s) missing from the end of
> line, so now the history line looks like this:
> X date | (null) | user | CurDir | special | rev(s) '\n'
> for example:
> M273b3463|(null)|dgg|~/work*9|usr/local/cvs/examples|1.2
>
> In the history_write() function, the only important difference between old
> history.c and new history.cpp:
>
> In the old history.c (in the v2.0.58d) write history line in this way:
>
>     sprintf (line, "%c%08lx|%s|%s|%s|%s|%s\n",
>            type, now,
>            username, workdir, repos, revs, name);
>
> the new history.cpp (in the v2.5.01.1949) write history line in this way:
>     sprintf (line, "%c%08lx|%s|%s|%s|%s|%s\n",
>            type, global_session_time_t,
>            username, workdir, repos, revs, name);
> using "global_session_time_t" instead of "now".
>
> May this cause the above-mentioned symptom? "global-session_time_t" maybe a
> 64bit number, but this history_writer() wait here a 32bit number.
> For this or other reasons,  but the symptom exists!
> Zoltán







More information about the cvsnt mailing list
Download the latest CVSNT, TortosieCVS, WinCVS etc. for Windows 8 etc.
@CVSNT on Twitter   CVSNT on Facebook