diff --git a/tools/qfcc/include/strpool.h b/tools/qfcc/include/strpool.h index e6e065cb8..6cdc8eb83 100644 --- a/tools/qfcc/include/strpool.h +++ b/tools/qfcc/include/strpool.h @@ -53,6 +53,8 @@ int strpool_addstr (strpool_t *strpool, const char *str); */ const char *save_string (const char *str); +const char *save_cwd (void); + const char *make_string (char *token, char **end); const char *html_string (const char *str); diff --git a/tools/qfcc/source/strpool.c b/tools/qfcc/source/strpool.c index 8fb7642e6..0f10f81ee 100644 --- a/tools/qfcc/source/strpool.c +++ b/tools/qfcc/source/strpool.c @@ -39,6 +39,7 @@ #endif #include #include +#include #include "QF/dstring.h" #include "QF/hash.h" @@ -140,6 +141,15 @@ save_string (const char *str) return s; } +const char * +save_cwd (void) +{ + char *cwd = getcwd (0, 0); + const char *str = save_string (cwd); + free (cwd); + return str; +} + const char * make_string (char *token, char **end) {