[ATTN: cvs maintainer] trailing dot issue with cygwin 1.7

crosmun_william@emc.com crosmun_william@emc.com
Sun Apr 4 15:02:00 GMT 2010


I haven't seen this reported in the mailing lists anywhere. My apologies if it has.  We are having problems with the cvs client running in Cygwin 1.7. There is a section of code in src/client.c

>     temp_filename = xmalloc (strlen (filename) + 80);
> #ifdef USE_VMS_FILENAMES
>          /* A VMS rename of "blah.dat" to "foo" to implies a
>             destination of "foo.dat" which is unfortinate for CVS */
>     sprintf (temp_filename, "%s_new_", filename);
> #else
> #ifdef _POSIX_NO_TRUNC
>     sprintf (temp_filename, ".new.%.9s", filename);  <----- Here's the problem
> #else /* _POSIX_NO_TRUNC */
>     sprintf (temp_filename, ".new.%s", filename);
> #endif /* _POSIX_NO_TRUNC */
> #endif /* USE_VMS_FILENAMES */

The _POSIX_NO_TRUNC variable is defined in cygwin 1.7, and not defined in cygwin 1.5, so in cygwin 1.7, the code goes down the path where the temp_filename is the first 9 characters of the original filename preceded by '.new.' The problem occurs when the 9th character in the filename is a dot. Eg, 'abcdefgh.txt'. The temp_filename becomes '.new.abcdefgh.'  Unfortunately, when checking out to a Samba share, or other network shares that try to be CIFS compatible, a trailing . is invalid in a filename. The temporary file either doesn't get created, or gets created but with the trailing dot truncated. The checkout then fails with 'file not found' errors. 

A simple fix would be to add a valid character after the .9s, eg

    sprintf (temp_filename, ".new.%.9s~", filename); 

Can something like this be done and a new package released?

William Crosmun 
BIRT
Email:  crosmun_william@emc.com
___________________________________________ 


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list