Fossil

Check-in [08311ffc]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Use file_delete() instead of unlink() in vfile_to_disk().
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | symlinks
Files: files | file ages | folders
SHA1: 08311ffc6a7bf92aa5d4b354c0391111612fd4d4
User & Date: dmitry 2011-08-28 11:01:51.329
Context
2011-08-28
11:22
Make blob_read_link() C89-compatible on Unix again. ... (check-in: 03481908 user: dmitry tags: symlinks)
11:01
Use file_delete() instead of unlink() in vfile_to_disk(). ... (check-in: 08311ffc user: dmitry tags: symlinks)
10:43
Handle errors in blob_read_link(). ... (check-in: d43029f6 user: dmitry tags: symlinks)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vfile.c.
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
      if( cReply=='n' || cReply=='N' ){
        blob_reset(&content);
        continue;
      }
    }
    if( verbose ) fossil_print("%s\n", &zName[nRepos]);
    if( file_isdir(zName) == 1 ){
      //TODO remove directories?
      fossil_fatal("%s is directory, cannot overwrite\n", zName);
    }    
    if( file_size(zName)>=0 && (isLink || file_islink(zName)) ){
      unlink(zName); //TODO(dchest) check this
    }
    if( isLink ){
      create_symlink(blob_str(&content), zName);
    }else{
      blob_write_to_file(&content, zName);
    }
    file_setexe(zName, isExe);







|



|







271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
      if( cReply=='n' || cReply=='N' ){
        blob_reset(&content);
        continue;
      }
    }
    if( verbose ) fossil_print("%s\n", &zName[nRepos]);
    if( file_isdir(zName) == 1 ){
      /*TODO(dchest): remove directories? */
      fossil_fatal("%s is directory, cannot overwrite\n", zName);
    }    
    if( file_size(zName)>=0 && (isLink || file_islink(zName)) ){
      file_delete(zName);
    }
    if( isLink ){
      create_symlink(blob_str(&content), zName);
    }else{
      blob_write_to_file(&content, zName);
    }
    file_setexe(zName, isExe);