Skip to content
Snippets Groups Projects
Commit a7669cac authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Better deduplication of the auto-added sub-dirs of a file lib

The configured path could be absolute or relative (to the parent). The trailing (back)slash is important to the string comparisons.
parent eeec384f
No related branches found
No related tags found
No related merge requests found
......@@ -217,11 +217,12 @@ void prep_cfg(scfg_t* cfg)
continue;
*tp = 0; // Remove trailing slash
char* dirname = getfname(p);
*tp = PATH_DELIM;
int j;
for(j = 0; j < cfg->total_dirs; j++) {
if(cfg->dir[j]->lib != i)
continue;
if(stricmp(cfg->dir[j]->lname, dirname) == 0)
if(strcmp(cfg->dir[j]->path, p) == 0 || strcmp(cfg->dir[j]->path, dirname) == 0)
break;
}
if(j < cfg->total_dirs) // duplicate
......@@ -231,7 +232,7 @@ void prep_cfg(scfg_t* cfg)
dir.lib = i;
dir.misc = DIR_DIZ;
SAFECOPY(dir.path, p);
backslash(dir.path);
*tp = 0; // Remove trailing slash
SAFECOPY(dir.lname, dirname);
SAFECOPY(dir.sname, dir.lname);
char code_suffix[LEN_EXTCODE+1];
......
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