Skip to content

Commit

Permalink
return PROJECT_SHORTNAME for D_DoomExeName() (#2120)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiangreffrath authored Jan 5, 2025
1 parent abd23ab commit dcf9341
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
17 changes: 2 additions & 15 deletions src/d_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,22 +604,9 @@ void D_AddFile(const char *file)
}

// killough 10/98: return the name of the program the exe was invoked as
char *D_DoomExeName(void)
const char *D_DoomExeName(void)
{
static char *name;

if (!name) // cache multiple requests
{
char *ext;

name = M_StringDuplicate(M_BaseName(myargv[0]));

ext = strrchr(name, '.');
if (ext)
*ext = '\0';
}

return name;
return PROJECT_SHORTNAME;
}

// Calculate the path to the directory for autoloaded WADs/DEHs.
Expand Down
2 changes: 1 addition & 1 deletion src/d_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct event_s;

void D_AddFile(const char *file);

char *D_DoomExeName(void); // killough 10/98: executable's name
const char *D_DoomExeName(void); // killough 10/98: executable's name
extern char *basesavegame; // killough 2/16/98: savegame path
extern char *screenshotdir; // [FG] screenshot path
void D_SetSavegameDirectory(void);
Expand Down

0 comments on commit dcf9341

Please sign in to comment.