bool file_utils::remove_extension(dynamic_string &filename) { int sep = -1; #if defined(PLATFORM_WINDOWS) int rightmost_backslash = filename.find_right('\\'); int rightmost_forwardslash = filename.find_right('/'); sep = VOGL_MAX(rightmost_backslash, rightmost_forwardslash); #endif if (sep < 0) sep = filename.find_right('/'); int dot = filename.find_right('.'); if (dot < sep) return false; filename.left(dot); return true; }