more loopfiles fixes
parent
ad168a2b81
commit
eab1987ab2
|
@ -2649,12 +2649,16 @@ ICOMMAND(loopfiles, "rsse", (ident *id, char *dir, char *ext, uint *body),
|
|||
identstack stack;
|
||||
vector<char *> files;
|
||||
listfiles(dir, ext[0] ? ext : NULL, files);
|
||||
loopv(files)
|
||||
loopvrev(files)
|
||||
{
|
||||
char *file = files[i];
|
||||
bool redundant = false;
|
||||
loopj(i) if(!strcmp(files[j], file)) { redundant = true; break; }
|
||||
if(redundant) { delete[] files.removeunordered(i--); continue; }
|
||||
if(redundant) delete[] files.removeunordered(i);
|
||||
}
|
||||
loopv(files)
|
||||
{
|
||||
char *file = files[i];
|
||||
if(i)
|
||||
{
|
||||
if(id->valtype == VAL_STR) delete[] id->val.s;
|
||||
|
|
Loading…
Reference in New Issue