home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.wwiv.com
/
ftp.wwiv.com.zip
/
ftp.wwiv.com
/
pub
/
MISC
/
MN321SRC.ZIP
/
osgenrms.c
< prev
next >
Wrap
C/C++ Source or Header
|
2004-07-11
|
495b
|
23 lines
/* $Id: osgenrms.c,v 1.2 2004/07/11 09:29:14 ozzmosis Exp $ */
/* remove slash/backslash from last part of path name, if present */
char *os_remove_slash(char *path1)
{
char *p;
char *path = path1;
if (!path)
return NULL;
if (*path && path[1] == ':')
path += 2; /* skip drive letter */
if ((p = strchr(path, '\0')) > path)
{
p--;
if (p > path && (*p == '\\' || *p == '/'))
*p = '\0';
}
return path1;
}