Index: trunk/src/sh_error.c
===================================================================
--- trunk/src/sh_error.c	(revision 509)
+++ trunk/src/sh_error.c	(revision 510)
@@ -244,4 +244,5 @@
 {
   char * p;
+  char * q;
   int    num = 0;
   unsigned int    i;
@@ -289,4 +290,6 @@
     if (p == NULL)
       break;
+
+    q = p; while (*q != '\0') { *q = toupper( (int) *q); ++q; }
 
     for (i = 0; i < SH_CLA_MAX; ++i)
@@ -495,4 +498,6 @@
   int i;
   int level = (-1);
+  char * tmp;
+  char * q;
   
   SL_ENTER(_("sh_error_convert_level"));
@@ -501,7 +506,10 @@
      SL_RETURN( -1, _("sh_error_convert_level"));
 
+  q = sh_util_strdup(str_s);
+  tmp = q; while (*tmp != '\0') { *tmp = tolower( (int) *tmp); ++tmp; }
+  
   for (i = 0; i < SH_EEF_MAX; ++i)
     {
-      if (0 == sl_strncmp(str_s, _(eef_tab[i].str), 
+      if (0 == sl_strncmp(q, _(eef_tab[i].str), 
                           sl_strlen(eef_tab[i].str))) 
 	{
@@ -511,4 +519,5 @@
     }
 
+  SH_FREE(q);
   SL_RETURN( level, _("sh_error_convert_level"));
 }
@@ -554,8 +563,15 @@
 
   int  old_facility;
-  const char * str_s = str_in;
+  char * str_s;
+  char * str_orig;
+  char * tmp;
 
   SL_ENTER(_("sh_error_set_level"));
 
+  str_s = sh_util_strdup(str_in);
+  str_orig = str_s;
+  
+  tmp = str_s; while (*tmp != '\0') { *tmp = tolower( (int) *tmp); ++tmp; }
+  
   if (IsInitialized == BAD) 
     (void) sh_error_init();
@@ -650,4 +666,5 @@
   if (!str_s)
     {
+      if (str_orig) SH_FREE(str_orig);
       SL_RETURN ((-1), _("sh_error_set_level"));
     }
@@ -675,8 +692,10 @@
       sh_error_handle ((-1), FIL__, __LINE__, EINVAL, MSG_EINVALS, 
 		       _("priority"), str_in);
+      SH_FREE(str_orig);
       SL_RETURN (-1, _("sh_error_set_level"));
     }
   compute_flag_err_debug();
   compute_flag_err_info();
+  SH_FREE(str_orig);
   SL_RETURN (0, _("sh_error_set_level"));
 }
