home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magazyn Exec 5
/
CD_Magazyn_EXEC_nr_5.iso
/
Recent
/
comm
/
mail
/
YAM23src.lha
/
Source
/
extrasrc
/
stcgfe.c
< prev
next >
Wrap
C/C++ Source or Header
|
2000-12-15
|
373b
|
19 lines
#include <string.h>
#include "extra.h"
/* Get the filename extension. */
int stcgfe(char *ext, const char *name)
{
const char *p = name + strlen(name);
const char *q = p;
while (p > name && *--p != '.' && *p != '/' && *p != ':');
if (*p++ == '.' && q - p < FESIZE)
{
memcpy(ext, p, q - p + 1);
return q - p;
}
*ext = '\0';
return 0;
}