Commit 836e8888 authored by rswindell's avatar rswindell
Browse files

Bug-fix: removecase() was supposed to return 0 upon success, but was returning

-1 on success and 0 on failure. Luckily, no caller has been checking the return
value.
parent 95e02bc3
......@@ -694,12 +694,13 @@ int removecase(const char *path)
}
*p=0;
return(delfiles(inpath,fname)?-1:0);
return(delfiles(inpath,fname) >=1 ? 0 : -1);
}
#endif
/****************************************************************************/
/* Deletes all files in dir 'path' that match file spec 'spec' */
/* Returns number of files deleted or negative on error */
/****************************************************************************/
ulong DLLCALL delfiles(const char *inpath, const char *spec)
{
......@@ -715,7 +716,7 @@ ulong DLLCALL delfiles(const char *inpath, const char *spec)
lastch=inpath[inpath_len-1];
path=(char *)malloc(inpath_len+1/*Delim*/+strlen(spec)+1/*Terminator*/);
if(path==NULL)
return 0;
return -1;
if(!IS_PATH_DELIM(lastch) && lastch)
sprintf(path,"%s%c",inpath,PATH_DELIM);
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment