Use file basename in -c urclock metadata under WIN32

This commit is contained in:
Stefan Rueger 2022-11-20 01:48:39 +00:00
parent 53de22cb83
commit c0e4dd494e
No known key found for this signature in database
GPG Key ID: B0B4F1FD86B1EC55
1 changed files with 5 additions and 0 deletions

View File

@ -542,8 +542,13 @@ static void set_date_filename(const PROGRAMMER *pgm, const char *fname) {
else { else {
ur.filename[0] = 0; ur.filename[0] = 0;
if(fname && *fname) { if(fname && *fname) {
#if !defined (WIN32)
if((base=strrchr(fname, '/'))) if((base=strrchr(fname, '/')))
base++; base++;
#else
if((base=strrchr(fname, '\\')))
base++;
#endif
else else
base = fname; base = fname;
strncpy(ur.filename, base, sizeof ur.filename-1); strncpy(ur.filename, base, sizeof ur.filename-1);