scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

canonical-posix.c (153B)


      1 #include <string.h>
      2 
      3 #include <scc/scc.h>
      4 
      5 char *
      6 canonical(char *path)
      7 {
      8 	char *name = strrchr(path, '/');
      9 	return (name && name[1]) ? name+1 : path;
     10 }