[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cvs import bug with binary files on Win32

From: Faller, Gyula
Subject: Cvs import bug with binary files on Win32
Date: Mon, 2 Jul 2001 10:57:10 +0200

 I found in the Win32 cvs version an odd thing (Not so serious, but very annoying):
 When I import more times the same binary file (with the correct expand mode (-kb)), there will be a new revision for each import with an empty delta. It confuses the ChangeLog for example. (The unix version works correctly meanwhile.)

 I experimented a while and it turned out, that the bug occurs if the binary file contains the hex '1A' (which is the Ctrl-Z character).

 I tracked down in the code to a function which determines weather the newly imported file changed after the last import. It calls the function named RCS_cmp_file, which was parametrized simply with a "-ko" as expand option, no matter this file was a binary or not. And thus the file being imported was opened for reading as a text or 'translated' file and not as a binary.

 On Win32 this means if the file contains a Ctrl-Z it means end of the file (and Ctrl-Z stripped). This was the reason why the Win32 version doesn't worked!!!

 So I propose to change the update_rcs_file in the import.c to taking account the binaryness of the diffed file as follows. (It caused a bug only on Win32 but incorrect on Unix too.)

*** OldSrc/import.c Thu Apr 19 21:45:32 2001
--- Src/Import.c Sun Jul  1 14:23:27 2001
*** 620,623 ****
--- 620,624 ----
      char *tocvsPath;
      struct file_info finfo;
+     char expand_options[4]; /* strlen("-kb" or "-ko") + 1 */
      memset (&finfo, 0, sizeof finfo);
*** 648,652 ****
   /* FIXME: Why don't we pass tocvsPath to RCS_cmp_file if it is
             not NULL?  */
!  different = RCS_cmp_file (vers->srcfile, vers->vn_rcs, "-ko", vfile);
   if (tocvsPath)
       if (unlink_file_dir (tocvsPath) < 0)
--- 649,658 ----
   /* FIXME: Why don't we pass tocvsPath to RCS_cmp_file if it is
             not NULL?  */
!  if (vers->srcfile->expand[0] == 'b') {
!   strcpy (expand_options, "-kb");
!  } else {
!   strcpy (expand_options, "-ko");
!  }
!  different = RCS_cmp_file (vers->srcfile, vers->vn_rcs, expand_options, vfile);
   if (tocvsPath)
       if (unlink_file_dir (tocvsPath) < 0)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]