Drop const from the output of filename_set_extension()

filename_set_extension() always returns a newly allocated string
buffer, drop the "const" from the return type.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin (Intel) 2026-06-26 17:24:17 -07:00
parent e47a62ed4d
commit 7b4e77dae2
2 changed files with 4 additions and 3 deletions

View file

@ -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...

View file

@ -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;