Wouldn't it be better, if ecore_str_has_suffix() were case-insensitive, 
because it is most time used to check for extensions? Or maybe to have 
another function that does the same job, but that use strcasecmp instead
strcmp?

Peter

Enlightenment CVS schrieb:
> Enlightenment CVS committal
>
> Author  : captainigloo
> Project : misc
> Module  : enna
>
> Dir     : misc/enna/src/bin
>
>
> Modified Files:
>       enna_util.c 
>
>
> Log Message:
> tests against file extensions are now case insensitive
>
> ===================================================================
> RCS file: /cvs/e/misc/enna/src/bin/enna_util.c,v
> retrieving revision 1.1
> retrieving revision 1.2
> diff -u -3 -r1.1 -r1.2
> --- enna_util.c       14 Jan 2008 22:16:05 -0000      1.1
> +++ enna_util.c       22 Jan 2008 18:25:57 -0000      1.2
> @@ -33,6 +33,7 @@
>  #include <stdlib.h>
>  #include <stdio.h>
>  #include <math.h>
> +#include <ctype.h>
>  
>  EAPI char          *
>  enna_util_user_home_get()
> @@ -54,12 +55,19 @@
>     Evas_List          *l;
>     int                 result = 0;
>  
> +   int i;
> +   char *tmp;
> +   
>     if (!patterns || !str || !str[0])
> -      return 0;
> +     return 0;
> +   
>     for (l = patterns; l; l = evas_list_next(l))
>       {
> -     //dbg("pattern : %s\n", (char*)l->data);
> -     result |= ecore_str_has_suffix(str, (char *)l->data);
> +     tmp = strdup(str);
> +     for (i = 0; i < strlen(str); i++)
> +       tmp[i] = tolower(str[i]);
> +     result |= ecore_str_has_suffix(tmp, (char *)l->data);
> +     free(tmp);
>       }
>     return result;
>  }
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> enlightenment-cvs mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs
>
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to