From 36c85b45eb0a85cea1560da9414595323fa56590 Mon Sep 17 00:00:00 2001 From: "kbr@google.com" Date: Mon, 3 May 2010 22:52:49 +0000 Subject: Compute the absolute path containing the o3dConverter tool for the case where it is being run from the current working directory and "." is not on the PATH. BUG=none TEST=none Review URL: http://codereview.chromium.org/1896001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46294 0039d316-1c4b-4281-b951-d872f2087c98 --- o3d/converter/cross/converter_main.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'o3d/converter') diff --git a/o3d/converter/cross/converter_main.cc b/o3d/converter/cross/converter_main.cc index 7822fe0..ee819a9 100644 --- a/o3d/converter/cross/converter_main.cc +++ b/o3d/converter/cross/converter_main.cc @@ -40,6 +40,7 @@ #include "base/at_exit.h" #include "base/command_line.h" #include "base/file_path.h" +#include "base/file_util.h" #include "base/string_util.h" #include "converter/cross/converter.h" #include "utils/cross/file_path_utils.h" @@ -69,7 +70,11 @@ int CrossMain(int argc, char**argv) { const CommandLine* command_line = CommandLine::ForCurrentProcess(); FilePath in_filename, out_filename; - const FilePath converter_tool = FilePath(argv[0]).DirName().Append( + // Use the absolute path to the converter tool for the case that we + // are in the current working directory and "." is not on the PATH. + FilePath converter_dir = FilePath(argv[0]).DirName(); + file_util::AbsolutePath(&converter_dir); + const FilePath converter_tool = converter_dir.Append( o3d::UTF8ToFilePath("convert.py")); -- cgit v1.1