patch 7.4.1418
Problem: job_stop() on MS-Windows does not really stop the job.
Solution: Make the default to stop the job forcefully. (Ken Takata)
Make MS-Windows and Unix more similar.
diff --git a/src/os_unix.c b/src/os_unix.c
index cebef64..3c0b48c 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -5202,12 +5202,14 @@
int sig = -1;
pid_t job_pid;
- if (STRCMP(how, "hup") == 0)
- sig = SIGHUP;
- else if (*how == NUL || STRCMP(how, "term") == 0)
+ if (*how == NUL || STRCMP(how, "term") == 0)
sig = SIGTERM;
+ else if (STRCMP(how, "hup") == 0)
+ sig = SIGHUP;
else if (STRCMP(how, "quit") == 0)
sig = SIGQUIT;
+ else if (STRCMP(how, "int") == 0)
+ sig = SIGINT;
else if (STRCMP(how, "kill") == 0)
sig = SIGKILL;
else if (isdigit(*how))
diff --git a/src/os_win32.c b/src/os_win32.c
index e93e6d0..b7b3930 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -5141,10 +5141,9 @@
int
mch_stop_job(job_T *job, char_u *how)
{
- int ret = 0;
- int ctrl_c = STRCMP(how, "int") == 0;
+ int ret;
- if (STRCMP(how, "kill") == 0)
+ if (STRCMP(how, "term") == 0 || STRCMP(how, "kill") == 0 || *how == NUL)
{
if (job->jv_job_object != NULL)
return TerminateJobObject(job->jv_job_object, 0) ? OK : FAIL;
@@ -5155,9 +5154,9 @@
if (!AttachConsole(job->jv_proc_info.dwProcessId))
return FAIL;
ret = GenerateConsoleCtrlEvent(
- ctrl_c ? CTRL_C_EVENT : CTRL_BREAK_EVENT,
- job->jv_proc_info.dwProcessId)
- ? OK : FAIL;
+ STRCMP(how, "int") == 0 ? CTRL_C_EVENT : CTRL_BREAK_EVENT,
+ job->jv_proc_info.dwProcessId)
+ ? OK : FAIL;
FreeConsole();
return ret;
}
diff --git a/src/version.c b/src/version.c
index 8af0a44..214b600 100644
--- a/src/version.c
+++ b/src/version.c
@@ -749,6 +749,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1418,
+/**/
1417,
/**/
1416,