FLTK logo

[fltk.general] Concerns regarding fl_filename_ext()

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Concerns regarding fl_filename_ext() "lifeatt... Apr 24, 2021  
  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.

Any thoughts?
Kevin

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/d07d812f-0830-4d20-ac6a-8522afec9ff9n%40googlegroups.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.