All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] provide stricmp
@ 2005-11-08 12:58 Jan Beulich
  2005-11-08 13:41 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2005-11-08 12:58 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 171 bytes --]

While strnicmp existed in the set of string support routines, stricmp
didn't, which this patch adjusts.

From: Jan Beulich <jbeulich@novell.com>

(actual patch attached)


[-- Attachment #2: linux-2.6.14-stricmp.patch --]
[-- Type: application/octet-stream, Size: 1392 bytes --]

While strnicmp existed in the set of string support routines, stricmp
didn't, which this patch adjusts.

From: Jan Beulich <jbeulich@novell.com>

--- 2.6.14/include/linux/string.h	2005-10-28 02:02:08.000000000 +0200
+++ 2.6.14-stricmp/include/linux/string.h	2005-11-04 16:19:34.000000000 +0100
@@ -47,6 +47,9 @@ extern int strcmp(const char *,const cha
 #ifndef __HAVE_ARCH_STRNCMP
 extern int strncmp(const char *,const char *,__kernel_size_t);
 #endif
+#ifndef __HAVE_ARCH_STRICMP
+extern int stricmp(const char *, const char *);
+#endif
 #ifndef __HAVE_ARCH_STRNICMP
 extern int strnicmp(const char *, const char *, __kernel_size_t);
 #endif
--- 2.6.14/lib/string.c	2005-10-28 02:02:08.000000000 +0200
+++ 2.6.14-stricmp/lib/string.c	2005-11-04 16:19:35.000000000 +0100
@@ -24,6 +24,31 @@
 #include <linux/ctype.h>
 #include <linux/module.h>
 
+#ifndef __HAVE_ARCH_STRICMP
+/**
+ * stricmp - Compare two strings case-insensitively
+ * @s1: One string
+ * @s2: Another string
+ */
+int stricmp(const char *s1, const char *s2)
+{
+	unsigned char c1, c2;
+
+	for (;;) {
+		c1 = *s1++;
+		c2 = *s2++;
+		if (!c1 || !c2)
+			break;
+		if (c1 == c2)
+			continue;
+		if ((c1 = tolower(c1)) != (c2 = tolower(c2)))
+			break;
+	}
+	return (int)c1 - (int)c2;
+}
+#endif
+EXPORT_SYMBOL(stricmp);
+
 #ifndef __HAVE_ARCH_STRNICMP
 /**
  * strnicmp - Case insensitive, length-limited string comparison

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] provide stricmp
  2005-11-08 12:58 [PATCH] provide stricmp Jan Beulich
@ 2005-11-08 13:41 ` Christoph Hellwig
  2005-11-08 14:20   ` Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2005-11-08 13:41 UTC (permalink / raw)
  To: Jan Beulich; +Cc: linux-kernel

On Tue, Nov 08, 2005 at 01:58:54PM +0100, Jan Beulich wrote:
> While strnicmp existed in the set of string support routines, stricmp
> didn't, which this patch adjusts.

There's still no user.  Please stop blindly resubmitting things that
have been rejected.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] provide stricmp
  2005-11-08 13:41 ` Christoph Hellwig
@ 2005-11-08 14:20   ` Jan Beulich
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2005-11-08 14:20 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-kernel

>>> Christoph Hellwig <hch@infradead.org> 08.11.05 14:41:21 >>>
>On Tue, Nov 08, 2005 at 01:58:54PM +0100, Jan Beulich wrote:
>> While strnicmp existed in the set of string support routines,
stricmp
>> didn't, which this patch adjusts.
>
>There's still no user.  Please stop blindly resubmitting things that
>have been rejected.

Consistency or anything similar doesn't count?

Jan


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-11-08 14:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-08 12:58 [PATCH] provide stricmp Jan Beulich
2005-11-08 13:41 ` Christoph Hellwig
2005-11-08 14:20   ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.