chiark / gitweb /
server, common: Split more code into utilities.
[tripe] / server / servutil.c
index c95b23fd26ee4bf8c1a52697acf0a00d8151c7ac..1f6301a4d14171e7928ddcf71151ede24b761c6e 100644 (file)
@@ -89,6 +89,23 @@ const char *timestr(time_t t)
   return ((const char *)buf_t);
 }
 
+/* --- @mystrieq@ --- *
+ *
+ * Arguments:  @const char *x, *y@ = two strings
+ *
+ * Returns:    True if @x@ and @y are equal, up to case.
+ */
+
+int mystrieq(const char *x, const char *y)
+{
+  for (;;) {
+    if (!*x && !*y) return (1);
+    if (tolower((unsigned char)*x) != tolower((unsigned char)*y))
+      return (0);
+    x++; y++;
+  }
+}
+
 /* --- @seq_reset@ --- *
  *
  * Arguments:  @seqwin *s@ = sequence-checking window