X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fmisc.c;h=b609b862ddadc4d07f99f6a132a82512bbd1b2f8;hb=755c246588092d0b281cb610a8371c2c9b32de59;hp=951449eb0c0b035246b02fc50f27d7a7c7e1a49f;hpb=5944f452b0e615a172a9f058877671ff6272abb8;p=chaz%2Ftar diff --git a/src/misc.c b/src/misc.c index 951449e..b609b86 100644 --- a/src/misc.c +++ b/src/misc.c @@ -417,6 +417,15 @@ maybe_backup_file (const char *file_name, bool this_is_the_archive) { struct stat file_stat; + assign_string (&before_backup_name, file_name); + + /* A run situation may exist between Emacs or other GNU programs trying to + make a backup for the same file simultaneously. If theoretically + possible, real problems are unlikely. Doing any better would require a + convention, GNU-wide, for all programs doing backups. */ + + assign_string (&after_backup_name, 0); + /* Check if we really need to backup the file. */ if (this_is_the_archive && _remdev (file_name)) @@ -438,14 +447,6 @@ maybe_backup_file (const char *file_name, bool this_is_the_archive) && (S_ISBLK (file_stat.st_mode) || S_ISCHR (file_stat.st_mode))) return true; - assign_string (&before_backup_name, file_name); - - /* A run situation may exist between Emacs or other GNU programs trying to - make a backup for the same file simultaneously. If theoretically - possible, real problems are unlikely. Doing any better would require a - convention, GNU-wide, for all programs doing backups. */ - - assign_string (&after_backup_name, 0); after_backup_name = find_backup_file_name (file_name, backup_type); if (! after_backup_name) xalloc_die ();