The behavior with /.hidden could probably be changed to match Unix conventions. Look for the last period that is at least 2 places beyond the last slash.
I've run into two issues with fl_filename_ext(). Using the latest github FLTK and Linux.
First, the documentation says the function returns NULL if there is no "last period". In fact, I've found the function returns the empty string in that case:
out = fl_filename_ext("/some/path/foo/");
assert(out != 0);
assert(strlen(out) == 0);
out = fl_filename_ext("/some/path/foo");
assert(out != 0);
assert(strlen(out) == 0);
This appears to be day-zero behavior, so a minor tweak to the documentation should be all that is required.
Second, how is a hidden file/folder expected to be handled? E.g.
out = fl_filename_ext("/some/path/foo/.hidden");
will return the string ".hidden", whereas I consider the path to not have an extension.
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.