From: Robert Pengelly <robertapengelly@hotmail.com>
Date: Tue, 24 Sep 2024 15:42:56 +0000 (+0100)
Subject: Don't remove target in mcopy
X-Git-Url: https://git.candlhat.org/?a=commitdiff_plain;h=fa2dcb9d35aed13af6c0c90fe794465ed4f02eeb;p=dosfstools.git

Don't remove target in mcopy
---

diff --git a/mcopy.c b/mcopy.c
index ef21690..0c92b04 100644
--- a/mcopy.c
+++ b/mcopy.c
@@ -1832,8 +1832,6 @@ int copy_from_image (const char *target, struct file_info *fi, const char *fname
             if (seekto (sector * 512) || fread (fi->scratch, 512, 1, ofp) != 1) {
             
                 fclose (tfp);
-                remove (target);
-                
                 return -1;
             
             }
@@ -1843,8 +1841,6 @@ int copy_from_image (const char *target, struct file_info *fi, const char *fname
                 if (fwrite (fi->scratch, 512, 1, tfp) != 1) {
                 
                     fclose (tfp);
-                    remove (target);
-                    
                     return -1;
                 
                 }
@@ -1865,8 +1861,6 @@ int copy_from_image (const char *target, struct file_info *fi, const char *fname
                 if (fwrite (fi->scratch, fi->bytes, 1, tfp) != 1) {
                 
                     fclose (tfp);
-                    remove (target);
-                    
                     return -1;
                 
                 }
@@ -2209,8 +2203,6 @@ int main (int argc, char **argv) {
             if (memcmp (source, "::", 2)) {
         
                 fclose (ofp);
-                remove (state->outfile);
-                
                 print_help (EXIT_FAILURE);
             
             }