aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32.c
diff options
context:
space:
mode:
authorEli Zaretskii2019-06-24 20:06:34 +0300
committerEli Zaretskii2019-06-24 20:06:34 +0300
commit9f5f5ae6386fe1ea9f31bd760d7ffd293d274502 (patch)
treeca27cef4db5fd9e02be339e8a8765b5c8dfe9342 /src/w32.c
parent38502cd44d58a92f378b0e6915a5360f32f6f1ab (diff)
downloademacs-9f5f5ae6386fe1ea9f31bd760d7ffd293d274502.tar.gz
emacs-9f5f5ae6386fe1ea9f31bd760d7ffd293d274502.zip
Fix MS-Windows build as followup to pdumper executable lookup
* src/w32.c (w32_my_exename): New function. * src/w32.h (w32_my_exename): Add prototype. * src/emacs.c (load_pdump_find_executable) [WINDOWSNT]: Find the actual file name of the program without looking along PATH, by calling w32_my_exename. * nt/mingw-cfg.site (ac_cv_func_canonicalize_file_name) (ac_cv_func_realpath, gl_cv_func_realpath_works): Disable testing. * nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_canonicalize-lgpl): Set to true.
Diffstat (limited to 'src/w32.c')
-rw-r--r--src/w32.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/w32.c b/src/w32.c
index 833ff4c7e4a..b2d1ffcf82b 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -9988,6 +9988,21 @@ w32_relocate (const char *epath_dir)
9988 return epath_dir; 9988 return epath_dir;
9989} 9989}
9990 9990
9991/* Return the full absolute name of the running executable.
9992
9993 Note: this function is called early during startup, when Unicode
9994 file name are not yet supported. */
9995char *
9996w32_my_exename (void)
9997{
9998 static char exename[MAX_PATH];
9999 if (!GetModuleFileNameA (NULL, exename, MAX_PATH))
10000 return NULL;
10001 /* FIXME: Resolve possible symlinks in the last component of
10002 exename, i.e. if the executable itself is a symlink. */
10003 return exename;
10004}
10005
9991/* 10006/*
9992 globals_of_w32 is used to initialize those global variables that 10007 globals_of_w32 is used to initialize those global variables that
9993 must always be initialized on startup even when the global variable 10008 must always be initialized on startup even when the global variable