patch-2.1.116 linux/arch/alpha/lib/strcasecmp.c
Next file: linux/arch/alpha/math-emu/fp-emul.c
Previous file: linux/arch/alpha/lib/io.c
Back to the patch index
Back to the overall index
-  Lines: 27
-  Date:
Sun Aug  9 12:09:05 1998
-  Orig file: 
v2.1.115/linux/arch/alpha/lib/strcasecmp.c
-  Orig date: 
Wed Dec 31 16:00:00 1969
diff -u --recursive --new-file v2.1.115/linux/arch/alpha/lib/strcasecmp.c linux/arch/alpha/lib/strcasecmp.c
@@ -0,0 +1,26 @@
+/*
+ *  linux/arch/alpha/lib/strcasecmp.c
+ */
+
+#include <linux/string.h>
+
+
+/* We handle nothing here except the C locale.  Since this is used in
+   only one place, on strings known to contain only 7 bit ASCII, this
+   is ok.  */
+
+int strcasecmp(const char *a, const char *b)
+{
+	int ca, cb;
+
+	do {
+		ca = *a++ & 0xff;
+		cb = *b++ & 0xff;
+		if (ca >= 'A' && ca <= 'Z')
+			ca += 'a' - 'A';
+		if (cb >= 'A' && cb <= 'Z')
+			cb += 'a' - 'A';
+	} while (ca == cb && ca != '\0');
+
+	return ca - cb;
+}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov