aboutsummaryrefslogtreecommitdiffstats
path: root/script.c
diff options
context:
space:
mode:
authorThomas Bushnell <tb@debian.org>2005-10-27 12:00:49 -0700
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:29 -0800
commit4e063c0de0bf319c9201cefa6f399364041bb7b9 (patch)
tree61a326cd4ab69f610d2e10313db2a641b6d0b4dd /script.c
parent5f7b0413c1bb0f96bb613ad74c0978f44116a136 (diff)
parent302e3218b7d487539ec305bf23881a6ee7d5be99 (diff)
downloadscm-4e063c0de0bf319c9201cefa6f399364041bb7b9.tar.gz
scm-4e063c0de0bf319c9201cefa6f399364041bb7b9.zip
Import Debian changes 5e1-1debian/5e1-1
scm (5e1-1) unstable; urgency=low * New upstream release. (Closes: #335970) * debian/rules (SCM_OPTIONS): Remove -F turtlegr; the file supporting this option seems to have gone by the wayside. * debian/rules (binary-arch): Don't try to install grtest.scm; it's gone now. * debian/rules (build-stamp): Use tee to capture output of ./build so that we can capture a copy of the file in the build log. * scm.1: Fix spelling errors in manual page: verobse -> verbose; qoutes -> quotes; aguments -> arguments; neccessary -> necessary; preceeds -> precedes. syncronization -> synchronization. (Closes: #300131) * debian/postinst, debian/prerm: Assume that install-docs is in the standard place, and test for it there with test -x. (Closes: #292996)
Diffstat (limited to 'script.c')
-rw-r--r--script.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/script.c b/script.c
index e186eb9..260e8b2 100644
--- a/script.c
+++ b/script.c
@@ -60,6 +60,11 @@
# endif /* def __sgi__ */
#endif /* def __SVR4 */
+#ifdef _WIN32
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h> /* GetModuleFileName */
+#endif
+
/* Concatentate str2 onto str1 at position n and return concatenated
string if file exists; 0 otherwise. */
@@ -167,7 +172,22 @@ char *find_impl_file(exec_path, generic_name, initname, sep)
char *sepptr = strrchr(exec_path, sep[0]);
char *extptr = exec_path + strlen(exec_path);
char *path = 0;
- /* fprintf(stderr, "dld_find_e %s\n", exec_path); fflush(stderr); */
+
+#ifdef _WIN32
+ char exec_buf[MAX_PATH];
+ HMODULE mod = GetModuleHandle(0); /* Returns module handle to current executable. */
+
+ if (mod) {
+ GetModuleFileName(mod, exec_buf, sizeof(exec_buf));
+ exec_path = exec_buf;
+ }
+#endif
+
+ /*fprintf(stderr, "dld_find_e %s\n", exec_path); fflush(stderr);*/
+
+ sepptr = strrchr(exec_path, sep[0]);
+ extptr = exec_path + strlen(exec_path);
+
if (sepptr) {
long sepind = sepptr - exec_path + 1L;