Re: What to expect after GIT 0.99.7

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Junio C Hamano <junkio@...>
Cc: <git@...>
Date: Sunday, September 18, 2005 - 9:30 pm

On Sun, 18 Sep 2005, Junio C Hamano wrote:

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;
+}
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
GIT 0.99.6, Junio C Hamano, (Wed Sep 7, 8:08 pm)
[ANNOUNCE] GIT 0.99.7, Junio C Hamano, (Sun Sep 18, 7:37 pm)
Re: [ANNOUNCE] GIT 0.99.7, Nigel Cunningham, (Sun Sep 18, 10:24 pm)
Re: [ANNOUNCE] GIT 0.99.7, Chris White, (Mon Sep 19, 8:01 am)
Re: [ANNOUNCE] GIT 0.99.7, Alan Chandler, (Mon Sep 19, 2:21 am)
[ANNOUNCE] Cogito-0.15, Petr Baudis, (Sun Sep 18, 9:14 pm)
Re: [ANNOUNCE] Cogito-0.15, Pavel Machek, (Mon Sep 19, 7:15 pm)
Re: [ANNOUNCE] Cogito-0.15, Linus Torvalds, (Mon Sep 19, 8:51 pm)
Re: [ANNOUNCE] Cogito-0.15, Petr Baudis, (Mon Sep 19, 8:35 pm)
What to expect after GIT 0.99.7, Junio C Hamano, (Sun Sep 18, 7:40 pm)
Re: What to expect after GIT 0.99.7, Anton Altaparmakov, (Mon Sep 19, 2:02 am)
Re: What to expect after GIT 0.99.7, Linus Torvalds, (Sun Sep 18, 9:30 pm)
Re: What to expect after GIT 0.99.7, Johannes Schindelin, (Mon Sep 19, 5:56 am)
Re: What to expect after GIT 0.99.7, Linus Torvalds, (Sun Sep 18, 10:02 pm)
No GIT 0.99.7 today, Junio C Hamano, (Sat Sep 17, 12:43 pm)
Tool renames and 'ls-files -t' output, Junio C Hamano, (Thu Sep 8, 6:14 pm)
RFC: s/git-merge-base/git-find-common-ancestor/g, Yasushi SHOJI, (Sun Sep 11, 3:02 am)
Re: RFC: s/git-merge-base/git-find-common-ancestor/g, Junio C Hamano, (Sun Sep 11, 3:38 am)
[PATCH] Rename git-merge-base to git-find-merge-base, Yasushi SHOJI, (Sun Sep 11, 4:40 am)
Post 0.99.7 preperation patches, Junio C Hamano, (Fri Sep 9, 5:20 am)
Re: Post 0.99.7 preperation patches, Petr Baudis, (Sun Sep 11, 9:26 pm)