diff --git a/polymer/eduke32/build/include/common.h b/polymer/eduke32/build/include/common.h index 742c89a03..76757a900 100644 --- a/polymer/eduke32/build/include/common.h +++ b/polymer/eduke32/build/include/common.h @@ -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 diff --git a/polymer/eduke32/source/common.c b/polymer/eduke32/source/common.c index 651032f5e..eecd4f7f6 100644 --- a/polymer/eduke32/source/common.c +++ b/polymer/eduke32/source/common.c @@ -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); +}