Hash :
b4ca09ac
Author :
Date :
2019-05-15T15:23:12
Add IsDirectory helper function to system_utils. This was previously a method in dEQP only. Cleanup change only. Bug: angleproject:3353 Change-Id: I9ac58ab52516f75efbb08bddb39466a40c07cbb8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1613892 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
//
// Copyright 2018 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// system_utils.cpp: Implementation of common functions
#include "system_utils.h"
namespace angle
{
bool PrependPathToEnvironmentVar(const char *variableName, const char *path)
{
std::string oldValue = GetEnvironmentVar(variableName);
const char *newValue = nullptr;
std::string buf;
if (oldValue.empty())
{
newValue = path;
}
else
{
buf = path;
buf += GetPathSeparator();
buf += oldValue;
newValue = buf.c_str();
}
return SetEnvironmentVar(variableName, newValue);
}
} // namespace angle