X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=miscutil.c;h=065cd5f6550f8aac28b0a17eda902faa44d42a2f;hp=ec4de4fd4a94495948c810af096602c4bb754be1;hb=5bd47a0905ccd076bbfad27c9da7b6906463380f;hpb=97110184221edacdb7d4dfc29de0e38d63f4d831 diff --git a/miscutil.c b/miscutil.c index ec4de4fd..065cd5f6 100644 --- a/miscutil.c +++ b/miscutil.c @@ -1,4 +1,4 @@ -const char miscutil_rcs[] = "$Id: miscutil.c,v 1.34 2002/03/24 13:25:43 swa Exp $"; +const char miscutil_rcs[] = "$Id: miscutil.c,v 1.36 2002/04/26 12:55:38 oes Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/miscutil.c,v $ @@ -36,6 +36,12 @@ const char miscutil_rcs[] = "$Id: miscutil.c,v 1.34 2002/03/24 13:25:43 swa Exp * * Revisions : * $Log: miscutil.c,v $ + * Revision 1.36 2002/04/26 12:55:38 oes + * New function string_toupper + * + * Revision 1.35 2002/03/26 22:29:55 swa + * we have a new homepage! + * * Revision 1.34 2002/03/24 13:25:43 swa * name change related issues * @@ -678,6 +684,43 @@ jb_err string_join(char **target_string, char *text_to_append) } +/********************************************************************* + * + * Function : string_toupper + * + * Description : Produce a copy of string with all convertible + * characters converted to uppercase. + * + * Parameters : + * 1 : string = string to convert + * + * Returns : Uppercase copy of string if possible, + * NULL on out-of-memory or if string was NULL. + * + *********************************************************************/ +char *string_toupper(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++ = toupper(*q++); + } + + return result; + +} + + /********************************************************************* * * Function : simplematch