sname.c

来自「speech signal process tools」· C语言 代码 · 共 31 行

C
31
字号
/*	Returns pointer to "simple" name of path name; that is,	pointer to first character after last "/".  If no slashes,	returns pointer to first char of arg.	If the string ends in a slash, returns a pointer to the first	character after the preceeding slash, or the first character.*//* static char *sccs_id = "@(#)sname.c	1.2 12/8/89 ESI, ATT"; */char	*sname(s)char *s;{	register char *p;	register int n;	register int j;	n = strlen(s);	--n;	if (s[n] == '/') {		for (j=n; j >= 0; --j)			if (s[j] != '/') {				s[++j] = '\0';				break;			}	}	for(p=s; *p; p++) if(*p == '/') s = p + 1;	return(s);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?