mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-27 09:20:51 +00:00
New helper function "char *dup_filename(const char *fn)" in common.h.
It allocates a buffer of size BMAX_PATH and copies the passed string into it. git-svn-id: https://svn.eduke32.com/eduke32@2560 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
0e3adea64e
commit
77918caf9c
2 changed files with 12 additions and 0 deletions
|
@ -60,4 +60,6 @@ int32_t fnlist_getnames(fnlist_t *fnl, const char *dirname, const char *pattern,
|
|||
void G_LoadGroupsInDir(const char *dirname);
|
||||
void G_DoAutoload(const char *dirname);
|
||||
|
||||
char *dup_filename(const char *fn);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -167,3 +167,13 @@ void G_DoAutoload(const char *dirname)
|
|||
Bsnprintf(buf, sizeof(buf), "autoload/%s", dirname);
|
||||
G_LoadGroupsInDir(buf);
|
||||
}
|
||||
|
||||
////
|
||||
|
||||
// returns a buffer of size BMAX_PATH
|
||||
char *dup_filename(const char *fn)
|
||||
{
|
||||
char *buf = Bmalloc(BMAX_PATH);
|
||||
|
||||
return Bstrncpyz(buf, fn, BMAX_PATH);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue