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

Re: What to expect after GIT 0.99.7

From
Linus Torvalds <torvalds@osdl.org>
Date
Sep 19, 2005, 01:30 UTC
Message-ID
<Pine.LNX.4.58.0509181829310.9106@g5.osdl.org>
In-Reply-To
<7vpsr6ymg3.fsf_-_@assigned-by-dhcp.cox.net>
On Sun, 18 Sep 2005, Junio C Hamano wrote:
Show 5 quoted lines
> 
> * Accept patches for more portability.
> 
>   * strcasestr() in mailinfo.  We may need compat/strcasestr.c;
>     this is bugging OpenBSD folks.
Maybe something stupid like this?
Totally untested, of course.
		Linus
---
diff-tree 9b2d397a5d03514bdf3f545e459817c48579830f (from 727132834e6be48a93c1bd6458a29d474ce7d5d5)
Author: Linus Torvalds <torvalds@g5.osdl.org>
Date:   Sun Sep 18 18:29:07 2005 -0700
Add stupid 'strcasestr()' compat routine
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
---
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,8 @@
 # Define NO_CURL if you do not have curl installed.  git-http-pull is not
 # built, and you cannot use http:// and https:// transports.
 #
+# Define NO_STRCASESTR if you don't have strcasestr.
+#
 # Define PPC_SHA1 environment variable when running make to make use of
 # a bundled SHA1 routine optimized for PowerPC.
 #
@@ -203,6 +205,10 @@ ifdef NEEDS_NSL
 	LIBS += -lnsl
 	SIMPLE_LIB += -lnsl
 endif
+ifdef NO_STRCASESTR
+	DEFINES += -Dstrcasestr=gitstrcasestr
+	LIB_OBJS += compat/strcasestr.o
+endif
 
 DEFINES += '-DSHA1_HEADER=$(SHA1_HEADER)'
 
diff --git a/compat/strcasestr.c b/compat/strcasestr.c
new file mode 100644
--- /dev/null
+++ b/compat/strcasestr.c
@@ -0,0 +1,22 @@
+#include <string.h>
+
+char *gitstrcasestr(const char *haystack, const char *needle)
+{
+	int nlen = strlen(needle);
+	int hlen = strlen(haystack) - nlen;
+	int i;
+
+	for (i = 0; i < hlen; i++) {
+		int j;
+		for (j = 0; j < nlen; j++) {
+			unsigned char c1 = haystack[i+j];
+			unsigned char c2 = needle[j];
+			if (toupper(c1) != toupper(c2))
+				goto next;
+		}
+		return (char *) haystack + i;
+	next:
+		;
+	}
+	return NULL;
+}
Previous: Junio C HamanoNext: Linus Torvalds
Message 12 of 28 in “GIT 0.99.6”
  1. Junio C HamanoSep 8, 2005
  2. Tool renames and 'ls-files -t' outputJunio C Hamano, Sep 8, 2005
  3. Post 0.99.7 preperation patchesJunio C Hamano, Sep 9, 2005
  4. Petr BaudisSep 12, 2005
  5. RFC: s/git-merge-base/git-find-common-ancestor/gYasushi SHOJI, Sep 11, 2005
  6. Junio C HamanoSep 11, 2005
  7. Rename git-merge-base to git-find-merge-baseYasushi SHOJI, Sep 11, 2005
  8. Tool rename fallout fixJunio C Hamano, Sep 9, 2005
  9. No GIT 0.99.7 todayJunio C Hamano, Sep 17, 2005
  10. [ANNOUNCE] GIT 0.99.7Junio C Hamano, Sep 18, 2005
  11. What to expect after GIT 0.99.7Junio C Hamano, Sep 18, 2005
  12. Linus TorvaldsSep 19, 2005
  13. Linus TorvaldsSep 19, 2005
  14. Johannes SchindelinSep 19, 2005
  15. Joachim B HagaSep 19, 2005
  16. Linus TorvaldsSep 19, 2005
  17. Anton AltaparmakovSep 19, 2005
  18. Matthias UrlichsSep 19, 2005
  19. Junio C HamanoSep 19, 2005
  20. Petr BaudisSep 19, 2005
  21. Linus TorvaldsSep 19, 2005
  22. [ANNOUNCE] Cogito-0.15Petr Baudis, Sep 19, 2005
  23. Pavel MachekSep 19, 2005
  24. Petr BaudisSep 20, 2005
  25. Linus TorvaldsSep 20, 2005
  26. Nigel CunninghamSep 19, 2005
  27. Chris WhiteSep 19, 2005
  28. Alan ChandlerSep 19, 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.