https://github.com/git/git
Raw File
Tip revision: 9918285fb10d81af9021dae99c5f4de88ded497c authored by Junio C Hamano on 07 July 2010, 18:19:42 UTC
Git 1.7.2-rc2
Tip revision: 9918285
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