https://github.com/git/git
Raw File
Tip revision: dff9f8835f2f2820c4e7109d242cb06b39f7d065 authored by Junio C Hamano on 19 February 2013, 05:48:05 UTC
Git 1.8.1.4
Tip revision: dff9f88
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