Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / tools / gn / function_rebase_path.cc
index 4f66688..078f007 100644 (file)
@@ -131,6 +131,13 @@ const char kRebasePath_Help[] =
     "  current directory to be relative to the build directory (which will\n"
     "  be the current directory when executing scripts).\n"
     "\n"
+    "  If you want to convert a file path to be source-absolute (that is,\n"
+    "  beginning with a double slash like \"//foo/bar\"), you should use\n"
+    "  the get_path_info() function. This function won't work because it will\n"
+    "  always make relative paths, and it needs to support making paths\n"
+    "  relative to the source root, so can't also generate source-absolute\n"
+    "  paths without more special-cases.\n"
+    "\n"
     "Arguments:\n"
     "\n"
     "  input\n"
@@ -253,9 +260,9 @@ Value RunRebasePath(Scope* scope,
     result = Value(function, Value::LIST);
     result.list_value().reserve(inputs.list_value().size());
 
-    for (size_t i = 0; i < inputs.list_value().size(); i++) {
+    for (const auto& input : inputs.list_value()) {
       result.list_value().push_back(
-          ConvertOnePath(scope, function, inputs.list_value()[i],
+          ConvertOnePath(scope, function, input,
                          from_dir, to_dir, convert_to_system_absolute, err));
       if (err->has_error()) {
         result = Value();