Skip to content
Snippets Groups Projects
Commit 926ef67c authored by deuce's avatar deuce
Browse files

More fixes for removecase()

- Don't allow ? or * in the path
- Various bug-fixes
parent 35f6f081
No related branches found
No related tags found
No related merge requests found
......@@ -573,7 +573,7 @@ BOOL DLLCALL fexistcase(char *path)
#endif
}
#ifndef _WIN32
#ifdef __unix__
int removecase(char *path)
{
char inpath[MAX_PATH+1];
......@@ -581,20 +581,22 @@ int removecase(char *path)
char tmp[5];
char *p;
int i;
if(strchr(path,'?') || strchr(path,'*'))
return(-1);
SAFECOPY(inpath,path);
p=getfname(inpath);
SAFECOPY(fname,p);
*p=0;
if(p>inpath)
*(p-1)=0;
fname[0]=0;
p++;
for(;*p;p++) {
if(isalpha(*p))
sprintf(tmp,"[%c%c]",toupper(*p),tolower(*p));
for(i=0;p[i];i++) {
if(isalpha(p[i]))
sprintf(tmp,"[%c%c]",toupper(p[i]),tolower(p[i]));
else
sprintf(tmp,"%c",*p);
sprintf(tmp,"%c",p[i]);
strncat(fname,tmp,MAX_PATH*4);
}
*p=0;
return(delfiles(inpath,fname)?-1:0);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment