From 8390f2255aa108ba29072bb94ccf235037577191 Mon Sep 17 00:00:00 2001 From: Heiko Hund Date: Fri, 18 Mar 2011 12:09:57 +0100 Subject: [PATCH] fix *connect script name, closes bug #3213131 --- scripts.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts.c b/scripts.c index 8eab008..4d614d6 100644 --- a/scripts.c +++ b/scripts.c @@ -2,7 +2,7 @@ * OpenVPN-GUI -- A Windows GUI for OpenVPN. * * Copyright (C) 2004 Mathias Sundman - * 2010 Heiko Hund + * 2011 Heiko Hund * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -47,7 +47,7 @@ RunPreconnectScript(connection_t *c) int i; /* Cut off extention from config filename and add "_pre.bat" */ - int len = _tcslen(c->config_file) - _tcslen(o.ext_string); + int len = _tcslen(c->config_file) - _tcslen(o.ext_string) - 1; _sntprintf_0(cmdline, _T("%s\\%.*s_pre.bat"), c->config_dir, len, c->config_file); /* Return if no script exists */ @@ -97,7 +97,7 @@ RunConnectScript(connection_t *c, int run_as_service) int i; /* Cut off extention from config filename and add "_up.bat" */ - int len = _tcslen(c->config_file) - _tcslen(o.ext_string); + int len = _tcslen(c->config_file) - _tcslen(o.ext_string) - 1; _sntprintf_0(cmdline, _T("%s\\%.*s_up.bat"), c->config_dir, len, c->config_file); /* Return if no script exists */ @@ -166,7 +166,7 @@ RunDisconnectScript(connection_t *c, int run_as_service) int i; /* Cut off extention from config filename and add "_down.bat" */ - int len = _tcslen(c->config_file) - _tcslen(o.ext_string); + int len = _tcslen(c->config_file) - _tcslen(o.ext_string) - 1; _sntprintf_0(cmdline, _T("%s\\%.*s_down.bat"), c->config_dir, len, c->config_file); /* Return if no script exists */