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

@@ -1225,17 +1225,11 @@ char * Format_font_filename(const char * fname)
}
// Add a skin to the list
void Add_font_or_skin(const char *name)
static void Add_font_or_skin(const char * full_name, const char * fname)
{
const char * fname;
int namelength;
// Cut the long name to keep only filename (no directory)
fname = Find_last_separator(name);
if (fname)
fname++;
else
fname = name;
size_t namelength;
(void)full_name;
namelength = strlen(fname);
if (namelength>=10 && fname[0]!='_' && !strncasecmp(fname, SKIN_PREFIX, strlen(SKIN_PREFIX))
&& (!strcasecmp(fname + namelength - 4,".png")