]> git.ipfire.org Git - thirdparty/git.git/blame - compat/basename.c
Refactor skipping DOS drive prefixes
[thirdparty/git.git] / compat / basename.c
CommitLineData
e1c06886
DA
1#include "../git-compat-util.h"
2
3/* Adapted from libiberty's basename.c. */
4char *gitbasename (char *path)
5{
6 const char *base;
2f36eed9 7 skip_dos_drive_prefix(&path);
e1c06886
DA
8 for (base = path; *path; path++) {
9 if (is_dir_sep(*path))
10 base = path + 1;
11 }
12 return (char *)base;
13}