aboutsummaryrefslogtreecommitdiffstats
path: root/lib/System/Win32
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-06-15 05:38:04 +0000
committerChris Lattner <sabre@nondot.org>2009-06-15 05:38:04 +0000
commitc5718d073c207a9986de1182f3725d45e3228d25 (patch)
treedf75e0728d9f8e01856c1f060e086a8613caede7 /lib/System/Win32
parent3771071dd8b396745d616ce5394391dd1ee4f713 (diff)
downloadexternal_llvm-c5718d073c207a9986de1182f3725d45e3228d25.zip
external_llvm-c5718d073c207a9986de1182f3725d45e3228d25.tar.gz
external_llvm-c5718d073c207a9986de1182f3725d45e3228d25.tar.bz2
"This patch implements the method with the GetModuleFileName function for windows."
Patch by Benjamin Kramer! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73379 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/Win32')
-rw-r--r--lib/System/Win32/Path.inc4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/System/Win32/Path.inc b/lib/System/Win32/Path.inc
index 62da3a3..683c94b 100644
--- a/lib/System/Win32/Path.inc
+++ b/lib/System/Win32/Path.inc
@@ -248,7 +248,9 @@ Path::GetCurrentDirectory() {
/// GetMainExecutable - Return the path to the main executable, given the
/// value of argv[0] from program startup.
Path Path::GetMainExecutable(const char *argv0, void *MainAddr) {
- return Path();
+ char pathname[MAX_PATH];
+ DWORD ret = ::GetModuleFileNameA(NULL, pathname, MAX_PATH);
+ return ret != MAX_PATH ? Path(pathname) : Path();
}