aboutsummaryrefslogtreecommitdiff
path: root/gcc/d/d-incpath.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/d/d-incpath.cc')
-rw-r--r--gcc/d/d-incpath.cc60
1 files changed, 31 insertions, 29 deletions
diff --git a/gcc/d/d-incpath.cc b/gcc/d/d-incpath.cc
index 8cec07b..3f62f43 100644
--- a/gcc/d/d-incpath.cc
+++ b/gcc/d/d-incpath.cc
@@ -67,47 +67,41 @@ prefixed_path (const char *path, const char *iprefix)
/* Add PATHS to the global import lookup path. */
static void
-add_globalpaths (Strings *paths)
+add_globalpaths (Strings &paths)
{
- if (paths)
+ for (size_t i = 0; i < paths.length; i++)
{
- for (size_t i = 0; i < paths->length; i++)
- {
- const char *path = (*paths)[i];
- const char *target = lrealpath (path);
-
- if (target == NULL || !FileName::exists (target))
- {
- if (target)
- free (CONST_CAST (char *, target));
- continue;
- }
+ const char *path = paths[i];
+ const char *target = lrealpath (path);
- global.path.push (target);
+ if (target == NULL || !FileName::exists (target))
+ {
+ if (target)
+ free (CONST_CAST (char *, target));
+ continue;
}
+
+ global.path.push (target);
}
}
/* Add PATHS to the global file import lookup path. */
static void
-add_filepaths (Strings *paths)
+add_filepaths (Strings &paths)
{
- if (paths)
+ for (size_t i = 0; i < paths.length; i++)
{
- for (size_t i = 0; i < paths->length; i++)
- {
- const char *path = (*paths)[i];
- const char *target = lrealpath (path);
-
- if (!FileName::exists (target))
- {
- free (CONST_CAST (char *, target));
- continue;
- }
+ const char *path = paths[i];
+ const char *target = lrealpath (path);
- global.filePath.push (target);
+ if (!FileName::exists (target))
+ {
+ free (CONST_CAST (char *, target));
+ continue;
}
+
+ global.filePath.push (target);
}
}
@@ -168,7 +162,11 @@ add_import_paths (const char *iprefix, const char *imultilib, bool stdinc)
{
const char *path = global.params.imppath[i];
if (path)
- add_globalpaths (FileName::splitPath (path));
+ {
+ Strings array;
+ FileName::appendSplitPath (path, array);
+ add_globalpaths (array);
+ }
}
/* Add string import search paths. */
@@ -176,6 +174,10 @@ add_import_paths (const char *iprefix, const char *imultilib, bool stdinc)
{
const char *path = global.params.fileImppath[i];
if (path)
- add_filepaths (FileName::splitPath (path));
+ {
+ Strings array;
+ FileName::appendSplitPath (path, array);
+ add_filepaths (array);
+ }
}
}