diff --git a/include/nasmlib.h b/include/nasmlib.h index a505a1296..ea0a880b9 100644 --- a/include/nasmlib.h +++ b/include/nasmlib.h @@ -368,9 +368,10 @@ static inline const char *nasm_digit_chars(bool ucase) int32_t seg_alloc(void); /* - * Add/replace or remove an extension to the end of a filename + * Add/replace or remove an extension to the end of a filename; + * returns a newly allocated buffer with the modified filename. */ -const char *filename_set_extension(const char *inname, const char *extension); +char *filename_set_extension(const char *inname, const char *extension); /* * Utility macros... diff --git a/nasmlib/path.c b/nasmlib/path.c index 0a0a67331..1d7ad8777 100644 --- a/nasmlib/path.c +++ b/nasmlib/path.c @@ -186,7 +186,7 @@ char *nasm_catfile(const char *dir, const char *file) * string buffer. If the extension is not an empty string, the first * character is replaced by the appropriate extsep for the filesystem. */ -const char *filename_set_extension(const char *inname, const char *extension) +char *filename_set_extension(const char *inname, const char *extension) { const char *nulp, *ep, *p; char *outname, *q;