Fossil SCM
Use file_delete() instead of unlink() in vfile_to_disk().
Commit
08311ffc6a7bf92aa5d4b354c0391111612fd4d4
Parent
d43029f6f450fbb…
1 file changed
+2
-2
+2
-2
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -273,15 +273,15 @@ | ||
| 273 | 273 | continue; |
| 274 | 274 | } |
| 275 | 275 | } |
| 276 | 276 | if( verbose ) fossil_print("%s\n", &zName[nRepos]); |
| 277 | 277 | if( file_isdir(zName) == 1 ){ |
| 278 | - //TODO remove directories? | |
| 278 | + /*TODO(dchest): remove directories? */ | |
| 279 | 279 | fossil_fatal("%s is directory, cannot overwrite\n", zName); |
| 280 | 280 | } |
| 281 | 281 | if( file_size(zName)>=0 && (isLink || file_islink(zName)) ){ |
| 282 | - unlink(zName); //TODO(dchest) check this | |
| 282 | + file_delete(zName); | |
| 283 | 283 | } |
| 284 | 284 | if( isLink ){ |
| 285 | 285 | create_symlink(blob_str(&content), zName); |
| 286 | 286 | }else{ |
| 287 | 287 | blob_write_to_file(&content, zName); |
| 288 | 288 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -273,15 +273,15 @@ | |
| 273 | continue; |
| 274 | } |
| 275 | } |
| 276 | if( verbose ) fossil_print("%s\n", &zName[nRepos]); |
| 277 | if( file_isdir(zName) == 1 ){ |
| 278 | //TODO remove directories? |
| 279 | fossil_fatal("%s is directory, cannot overwrite\n", zName); |
| 280 | } |
| 281 | if( file_size(zName)>=0 && (isLink || file_islink(zName)) ){ |
| 282 | unlink(zName); //TODO(dchest) check this |
| 283 | } |
| 284 | if( isLink ){ |
| 285 | create_symlink(blob_str(&content), zName); |
| 286 | }else{ |
| 287 | blob_write_to_file(&content, zName); |
| 288 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -273,15 +273,15 @@ | |
| 273 | continue; |
| 274 | } |
| 275 | } |
| 276 | if( verbose ) fossil_print("%s\n", &zName[nRepos]); |
| 277 | if( file_isdir(zName) == 1 ){ |
| 278 | /*TODO(dchest): remove directories? */ |
| 279 | fossil_fatal("%s is directory, cannot overwrite\n", zName); |
| 280 | } |
| 281 | if( file_size(zName)>=0 && (isLink || file_islink(zName)) ){ |
| 282 | file_delete(zName); |
| 283 | } |
| 284 | if( isLink ){ |
| 285 | create_symlink(blob_str(&content), zName); |
| 286 | }else{ |
| 287 | blob_write_to_file(&content, zName); |
| 288 |