summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9a888b7)
raw | patch | inline | side by side (parent: 9a888b7)
author | Junio C Hamano <junkio@cox.net> | |
Fri, 18 Nov 2005 23:40:22 +0000 (15:40 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 18 Nov 2005 23:40:22 +0000 (15:40 -0800) |
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>
with .exe, to make it a bit more readable on Cygwin.
Signed-off-by: Junio C Hamano <junkio@cox.net>
git.c | patch | blob | history |
index b9b8c62f47cc54ef03161e61569dcd0d7b259828..bdd3f8d01c0be5edeccf8b99c98a1cff5d70dbc2 100644 (file)
--- a/git.c
+++ b/git.c
if (!ent)
oom();
ent->len = len;
- memcpy(ent->name, name, len+1);
+ memcpy(ent->name, name, len);
+ ent->name[len] = 0;
cmdname[cmdname_cnt++] = ent;
}
continue;
entlen = strlen(de->d_name);
+ if (4 < entlen && !strcmp(de->d_name + entlen - 4, ".exe"))
+ entlen -= 4;
if (longest < entlen)
longest = entlen;