H. Peter Anvin (Intel) ff7a315acb nasmlib: move filename_set_extension() into path.c
Move filename_set_extension() into path.c, so it has access to the
filesystem-specific character constants. This prevents something like:

	nasm-code.d/foobar

... from getting truncated to ...

	nasm-code.bin

... instead of producing ...

	nasm-code.d/foobar.bin

Make the extension character (normally '.') configurable; this MIGHT
be usable on RISCOS at some point, although it is not entirely clear
that trying to make sense of RISCOS paths actually is meaningful,
because RISCOS compiler chains seem to do all kinds of path
translation magic trying to behave like other operating systems... it
might simply be more trouble than it is worth, especially for a
non-x86 platform.

As a side bonus, this removes the only use of strrchrnul(), so that
function can be dropped.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-12-15 09:58:42 -08:00
..