This is the mail archive of the
cygwin
mailing list for the Cygwin project.
[ATTN: cvs maintainer] trailing dot issue with cygwin 1.7
- From: <crosmun_william at emc dot com>
- To: <cygwin at cygwin dot com>
- Date: Sun, 4 Apr 2010 11:01:34 -0400
- Subject: [ATTN: cvs maintainer] trailing dot issue with cygwin 1.7
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