swh:1:snp:47f1e8bb459169b0feb652a9c3d9cbabd8526d4a
Raw File
Tip revision: ec014eac0e9e6f30cbbca616090fa2ecf74797e7 authored by Junio C Hamano on 24 April 2011, 06:36:32 UTC
Git 1.7.5
Tip revision: ec014ea
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