*
* Function : hash_string
*
- * Description : Take a string and compute a (hopefuly) unique numeric
+ * Description : Take a string and compute a (hopefully) unique numeric
* integer value. This is useful to "switch" a string.
*
* Parameters :
}
+/*********************************************************************
+ *
+ * Function : string_tolower
+ *
+ * Description : Produce a copy of string with all convertible
+ * characters converted to lowercase.
+ *
+ * Parameters :
+ * 1 : string = string to convert
+ *
+ * Returns : Lowercase copy of string if possible,
+ * NULL on out-of-memory or if string was NULL.
+ *
+ *********************************************************************/
+char *string_tolower(const char *string)
+{
+ char *result, *p;
+ const char *q;
+
+ if (!string || ((result = (char *)zalloc(strlen(string) + 1)) == NULL))
+ {
+ return NULL;
+ }
+
+ q = string;
+ p = result;
+
+ while (*q != '\0')
+ {
+ *p++ = (char)privoxy_tolower(*q++);
+ }
+
+ return result;
+
+}
+
+
/*********************************************************************
*
* Function : string_move
* 1 : string = string to be duplicated
* 2 : len = number of bytes to duplicate
*
- * Returns : pointer to copy, or NULL if failiure
+ * Returns : pointer to copy, or NULL if failure
*
*********************************************************************/
char *bindup(const char *string, size_t len)