git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Do not show .exe in git command list.

From
Junio C Hamano <junkio@cox.net>
Date
Nov 18, 2005, 23:44 UTC
Message-ID
<7vacg1frm9.fsf_-_@assigned-by-dhcp.cox.net>
In-Reply-To
<437E5A79.9070402@gmail.com>

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>
---
 Today I borrowed a Cygwin environment to build things without
 any customization (no config.mak nor make command line
 override), and I have to report that make test passed OK for
 me.
 git.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

applies-to: ff891e258456492507934e82d90fd8aacb124845 f9039f30d56e3815eaab870d8b19c7b94aded8aa

diff --git a/git.c b/git.c
index b9b8c62..bdd3f8d 100644
--- a/git.c
+++ b/git.c
@@ -59,7 +59,8 @@ static void add_cmdname(const char *name
 	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;
 }
 
@@ -132,6 +133,8 @@ static void list_commands(const char *ex
 			continue;
 
 		entlen = strlen(de->d_name);
+		if (4 < entlen && !strcmp(de->d_name + entlen - 4, ".exe"))
+			entlen -= 4;
 
 		if (longest < entlen)
 			longest = entlen;
---
0.99.9.GIT
Previous: John Benes
Message 20 of 20 in “"make test" fails with current HEAD”
  1. Matthias UrlichsNov 17, 2005
  2. Johannes SchindelinNov 17, 2005
  3. Matthias UrlichsNov 17, 2005
  4. A Large Angry SCMNov 18, 2005
  5. Johannes SchindelinNov 18, 2005
  6. Matthias UrlichsNov 18, 2005
  7. Junio C HamanoNov 18, 2005
  8. Matthias UrlichsNov 18, 2005
  9. Junio C HamanoNov 18, 2005
  10. Matthias UrlichsNov 18, 2005
  11. Johannes SchindelinNov 18, 2005
  12. Matthias UrlichsNov 18, 2005
  13. Johannes SchindelinNov 18, 2005
  14. Matthias UrlichsNov 18, 2005
  15. Linus TorvaldsNov 18, 2005
  16. Junio C HamanoNov 18, 2005
  17. Junio C HamanoNov 18, 2005
  18. Junio C HamanoNov 18, 2005
  19. John BenesNov 18, 2005
  20. Do not show .exe in git command list.Junio C Hamano, Nov 18, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.