https://github.com/git/git
Raw File
Tip revision: e6363a4992637267ef212d7c709ede17d4122e0d authored by Junio C Hamano on 01 March 2013, 21:15:29 UTC
Git 1.8.1.5
Tip revision: e6363a4
basename.c
#include "../git-compat-util.h"

/* Adapted from libiberty's basename.c.  */
char *gitbasename (char *path)
{
	const char *base;
	/* Skip over the disk name in MSDOS pathnames. */
	if (has_dos_drive_prefix(path))
		path += 2;
	for (base = path; *path; path++) {
		if (is_dir_sep(*path))
			base = path + 1;
	}
	return (char *)base;
}
back to top