+char* filename_to_lowercase(const char*name)
+{
+ char*n = strdup(name);
+ //char*x1 = strrchr(name, '/');
+ //char*x2 = strrchr(name, '\\');
+ char*s = n;
+ //if(x1+1>s) s=x1+1;
+ //if(x2+1>s) s=x2+1;
+ while(*s) {
+ /* FIXME: what we probably should do here is use libc's tolower().
+ I don't really know yet, though, how Windows (or MacOS X) handles
+ lowercasing of Unicode filenames */
+ if(*s>='A' && *s<='Z')
+ *s += 'a'-'A';
+ s++;
+ }
+ return n;
+}
+