| iMatix home page | << | < | > | >> |
SFL Version 2.11 |
#include "sflfile.h" char * strip_extension ( char *name)
Removes dot and extension from the name, if any was present. If the name contained multiple extensions, removes the last one only. Returns name.
{ char *dot, *slash; ASSERT (name); dot = strrchr (name, '.'); /* Find dot in name, if any */ slash = strrchr (name, '\\'); /* Find last slash (DOS or Unix) */ if (slash == NULL) slash = strrchr (name, '/'); if (dot > slash) *dot = 0; /* If we had a dot, truncate name */ return (name); }
| << | < | > | >> | Copyright © 1996-2000 iMatix Corporation |