Commit 9e3e7b0f5d079d4651d7aa06a98cc029891ca872

Authored by DarkGod
1 parent 42da6f28

fix for addons

Showing 1 changed file with 9 additions and 1 deletions
... ... @@ -364,7 +364,15 @@ static char *sanize_dir_path(const char *dir, size_t len) {
364 364 size_t si = 0;
365 365
366 366 bool was_sep = FALSE;
367   - for (size_t i = 0; i < len;) {
  367 + size_t i = 0;
  368 +
  369 + // Handle subdir:/foo|/real/path
  370 + if (strstr(dir, "subdir:/") == dir) {
  371 + char *split = strrchr(dir, '|');
  372 + if (split) i += split - dir + 1;
  373 + }
  374 +
  375 + for (; i < len;) {
368 376 // We found a separator
369 377 if (strstr(&dir[i], sep) == &dir[i]) {
370 378 // More than one separator, skip it
... ...