update For_each_file() to pass both full path and file name only to the callback

All  callbacks need to extract the filename anyway, so it simplify the code
This commit is contained in:
Thomas Bernard
2018-02-13 10:30:10 +01:00
parent a4593da4d4
commit 4a2754321f
5 changed files with 13 additions and 27 deletions

View File

@@ -1492,17 +1492,15 @@ const int Max_edits_for_safety_backup = 30;
///
/// Adds a file to Backups_main or Backups_spare lists, if it's a backup.
///
void Add_backup_file(const char *name)
static void Add_backup_file(const char * full_name, const char *file_name)
{
T_String_list ** list;
T_String_list * elem;
int i;
char file_name[MAX_PATH_CHARACTERS];
(void)full_name;
// Only files names of the form a0000000.* and b0000000.* are expected
Extract_filename(file_name, name);
// Check first character
if (file_name[0]==Main.safety_backup_prefix)
list = &Backups_main;