FLTK logo

Re: [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 ]

Re: Concerns regarding fl_filename_ext() Albrecht Schlosser Apr 26, 2021  
 
On 4/26/21 9:38 PM Bill Spitzak wrote:
Returning nullptr is a very bad idea, as almost any calling code will have to test for this, usually to change it right back to "".

Okay...

Returning "" (actually the nul at the end of the filename) if there is no extension, and returning starting from the period if there is one, is the original design and was always intended. This was so the offset into the filename was where the period would be written if you wanted to change the extension.

Understood. Thanks for the clarification.

Then we should really update the docs.

I agree it would be best to fix it to ignore any period before the first non-period after the last slash, so that ".hidden" and ".." and so on act like they have no extension.

Yep, and that would then also be platform independent.

--
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/cc5c6e37-c52b-39c0-f627-6217dc5b7cfc%40online.de.
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'.