diff options
author | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-03 22:52:49 +0000 |
---|---|---|
committer | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-03 22:52:49 +0000 |
commit | 36c85b45eb0a85cea1560da9414595323fa56590 (patch) | |
tree | d301d790832f06a06e1ff070004d0084eebce920 /o3d/converter | |
parent | 789c6f19c845f5a272da87b035629fc3636d65d2 (diff) | |
download | chromium_src-36c85b45eb0a85cea1560da9414595323fa56590.zip chromium_src-36c85b45eb0a85cea1560da9414595323fa56590.tar.gz chromium_src-36c85b45eb0a85cea1560da9414595323fa56590.tar.bz2 |
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
Diffstat (limited to 'o3d/converter')
-rw-r--r-- | o3d/converter/cross/converter_main.cc | 7 |
1 files changed, 6 insertions, 1 deletions
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")); |