diff options
Diffstat (limited to 'src/filename_setext.cxx')
| -rw-r--r-- | src/filename_setext.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/filename_setext.cxx b/src/filename_setext.cxx index d922dd3aa..e61b59938 100644 --- a/src/filename_setext.cxx +++ b/src/filename_setext.cxx @@ -26,14 +26,24 @@ // // Replace .ext with new extension -// If no . in name, append new extension -// If new extension is null, act like it is "" #include <FL/filename.H> #include "flstring.h" /** - Replaces the extension in \p buf of max. size \p buflen with the extension in \p ext. + Replaces the extension in \p buf of max.<br> + size \p buflen with the extension in \p ext.<br> + If there's no '.' in \p buf, \p ext is appended.<br> + If \p ext is NULL, behaves as if it were an empty string (""). + + \b Example + \code + #include <FL/filename.H> + [..] + char buf[1024] = "/path/myfile.cxx"; + fl_filename_setext(buf, sizeof(buf), ".txt"); // buf[] becomes "/path/myfile.txt" + \endcode + \return buf itself for calling convenience. */ char *fl_filename_setext(char *buf, int buflen, const char *ext) { |
