mirror of
https://github.com/git/git
synced 2024-08-26 19:19:18 +00:00
Do not show .exe in git command list.
Truncate the result from readdir() in the exec-path if they end with .exe, to make it a bit more readable on Cygwin. Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
9a888b758f
commit
f9039f30d5
5
git.c
5
git.c
|
@ -59,7 +59,8 @@ static void add_cmdname(const char *name, int len)
|
||||||
if (!ent)
|
if (!ent)
|
||||||
oom();
|
oom();
|
||||||
ent->len = len;
|
ent->len = len;
|
||||||
memcpy(ent->name, name, len+1);
|
memcpy(ent->name, name, len);
|
||||||
|
ent->name[len] = 0;
|
||||||
cmdname[cmdname_cnt++] = ent;
|
cmdname[cmdname_cnt++] = ent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,6 +133,8 @@ static void list_commands(const char *exec_path, const char *pattern)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
entlen = strlen(de->d_name);
|
entlen = strlen(de->d_name);
|
||||||
|
if (4 < entlen && !strcmp(de->d_name + entlen - 4, ".exe"))
|
||||||
|
entlen -= 4;
|
||||||
|
|
||||||
if (longest < entlen)
|
if (longest < entlen)
|
||||||
longest = entlen;
|
longest = entlen;
|
||||||
|
|
Loading…
Reference in a new issue