home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.2.286 < prev    next >
Encoding:
Internet Message Format  |  2004-02-23  |  2.2 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.2.286
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.2.286
  11. Problem:    When trying to rename a file and it doesn't exist, the destination
  12.         file is deleted anyway. (Luc Deux)
  13. Solution:   Don't delete the destination when the source doesn't exist. (Taro
  14.         Muraoka)
  15. Files:        src/fileio.c
  16.  
  17.  
  18. *** ../vim-6.2.285/src/fileio.c    Fri Jan 30 21:03:16 2004
  19. --- src/fileio.c    Sat Feb 21 12:09:01 2004
  20. ***************
  21. *** 5249,5254 ****
  22. --- 5249,5255 ----
  23.   #ifdef AMIGA
  24.       BPTR    flock;
  25.   #endif
  26. +     struct stat    st;
  27.   
  28.       /*
  29.        * When the names are identical, there is nothing to do.
  30. ***************
  31. *** 5257,5265 ****
  32.       return 0;
  33.   
  34.       /*
  35. !      * First delete the "to" file, this is required on some systems to make
  36. !      * the mch_rename() work, on other systems it makes sure that we don't
  37. !      * have two files when the mch_rename() fails.
  38.        */
  39.   
  40.   #ifdef AMIGA
  41. --- 5258,5272 ----
  42.       return 0;
  43.   
  44.       /*
  45. !      * Fail if the "from" file doesn't exist.  Avoids that "to" is deleted.
  46. !      */
  47. !     if (mch_stat((char *)from, &st) < 0)
  48. !     return -1;
  49. !     /*
  50. !      * Delete the "to" file, this is required on some systems to make the
  51. !      * mch_rename() work, on other systems it makes sure that we don't have
  52. !      * two files when the mch_rename() fails.
  53.        */
  54.   
  55.   #ifdef AMIGA
  56. *** ../vim-6.2.285/src/version.c    Fri Feb 20 22:14:29 2004
  57. --- src/version.c    Tue Feb 24 15:17:27 2004
  58. ***************
  59. *** 639,640 ****
  60. --- 639,642 ----
  61.   {   /* Add new patch number below this line */
  62. + /**/
  63. +     286,
  64.   /**/
  65.  
  66. -- 
  67. "The amigos also appear to be guilty of not citing the work of others who had
  68. gone before them.  Even worse, they have a chapter about modeling time and
  69. space without making a single reference to Star Trek!"
  70.             (Scott Ambler, reviewing the UML User Guide)
  71.  
  72.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  73. ///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  74. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  75.  \\\  Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html  ///
  76.