/* Return a pointer to the part of PATHNAME that simply defines the file. */ char * filename_non_directory (char *pathname) { register char *filename = pathname + strlen (pathname); if (HAVE_DRIVE (pathname)) pathname += 2; while (filename > pathname && !IS_SLASH (filename[-1])) filename--; return filename; }
/* Return the index of the first character in the filename which is past all the leading directory characters. */ static int skip_directory_part (char *filename) { int i = strlen (filename) - 1; while (i && !IS_SLASH (filename[i])) i--; if (IS_SLASH (filename[i])) i++; else if (filename[i] && HAVE_DRIVE (filename)) i = 2; return i; }