From 8f8424445810aa7d5e9d4d537494e64811a8e29f Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sun, 18 Aug 2013 18:20:41 +0200 Subject: [PATCH] Don't force a .bat extension for scripts under Windows. --- doc/tinc.texi | 4 ++-- src/invitation.c | 6 ------ src/net_setup.c | 4 ---- src/tincctl.c | 6 ------ 4 files changed, 2 insertions(+), 18 deletions(-) diff --git a/doc/tinc.texi b/doc/tinc.texi index a2952933..6f128f81 100644 --- a/doc/tinc.texi +++ b/doc/tinc.texi @@ -1346,7 +1346,7 @@ Setting this options also implicitly sets IndirectData. @cindex scripts Apart from reading the server and host configuration files, tinc can also run scripts at certain moments. -Under Windows (not Cygwin), the scripts should have the extension .bat. +Under Windows (not Cygwin), the scripts should have the extension @file{.bat} or @file{.cmd}. @table @file @cindex tinc-up @@ -1386,7 +1386,7 @@ This script is started when a Subnet becomes unreachable. The scripts are started without command line arguments, but can make use of certain environment variables. Under UNIX like operating systems the names of environment variables must be preceded by a $ in scripts. -Under Windows, in @file{.bat} files, they have to be put between % signs. +Under Windows, in @file{.bat} or @file{.cmd} files, they have to be put between % signs. @table @env @cindex NETNAME diff --git a/src/invitation.c b/src/invitation.c index f1cde581..a5904509 100644 --- a/src/invitation.c +++ b/src/invitation.c @@ -32,12 +32,6 @@ #include "utils.h" #include "xalloc.h" -#ifdef HAVE_MINGW -#define SCRIPTEXTENSION ".bat" -#else -#define SCRIPTEXTENSION "" -#endif - int addressfamily = AF_UNSPEC; char *get_my_hostname() { diff --git a/src/net_setup.c b/src/net_setup.c index 6aeceaf3..64d25150 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -455,11 +455,7 @@ bool setup_myself_reloadable(void) { free(scriptextension); if(!get_config_string(lookup_config(config_tree, "ScriptsExtension"), &scriptextension)) -#ifdef HAVE_MINGW - scriptextension = xstrdup(".bat"); -#else scriptextension = xstrdup(""); -#endif get_config_string(lookup_config(config_tree, "Proxy"), &proxy); if(proxy) { diff --git a/src/tincctl.c b/src/tincctl.c index 55e14e53..f133e2de 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -39,12 +39,6 @@ #include "tincctl.h" #include "top.h" -#ifdef HAVE_MINGW -#define SCRIPTEXTENSION ".bat" -#else -#define SCRIPTEXTENSION "" -#endif - static char **orig_argv; static int orig_argc; -- 2.20.1