diff --git a/src/auto/configure b/src/auto/configure index 842b000e23..0474792047 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -12146,7 +12146,7 @@ fi for ac_func in fchdir fchown fsync getcwd getpseudotty \ getpwent getpwnam getpwuid getrlimit gettimeofday getwd lstat \ memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \ - setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ + getpgid setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ sigprocmask sigvec strcasecmp strerror strftime stricmp strncasecmp \ strnicmp strpbrk strtol tgetent towlower towupper iswupper \ usleep utime utimes diff --git a/src/config.h.in b/src/config.h.in index 38b0ccf53e..49ed596f47 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -158,7 +158,9 @@ #undef HAVE_FCHOWN #undef HAVE_FSEEKO #undef HAVE_FSYNC +#undef HAVE_FLOAT_FUNCS #undef HAVE_GETCWD +#undef HAVE_GETPGID #undef HAVE_GETPSEUDOTTY #undef HAVE_GETPWENT #undef HAVE_GETPWNAM @@ -167,13 +169,12 @@ #undef HAVE_GETTIMEOFDAY #undef HAVE_GETWD #undef HAVE_ICONV -#undef HAVE_NL_LANGINFO_CODESET #undef HAVE_LSTAT #undef HAVE_MEMSET #undef HAVE_MKDTEMP #undef HAVE_NANOSLEEP +#undef HAVE_NL_LANGINFO_CODESET #undef HAVE_OPENDIR -#undef HAVE_FLOAT_FUNCS #undef HAVE_PUTENV #undef HAVE_QSORT #undef HAVE_READLINK diff --git a/src/configure.ac b/src/configure.ac index bf6a94d2e7..0113f170fb 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -3694,7 +3694,7 @@ dnl Can only be used for functions that do not require any include. AC_CHECK_FUNCS(fchdir fchown fsync getcwd getpseudotty \ getpwent getpwnam getpwuid getrlimit gettimeofday getwd lstat \ memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \ - setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ + getpgid setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ sigprocmask sigvec strcasecmp strerror strftime stricmp strncasecmp \ strnicmp strpbrk strtol tgetent towlower towupper iswupper \ usleep utime utimes) diff --git a/src/diff.c b/src/diff.c index 7b81feba7a..435269984e 100644 --- a/src/diff.c +++ b/src/diff.c @@ -906,6 +906,7 @@ ex_diffpatch(exarg_T *eap) int browse_flag = cmdmod.browse; #endif stat_T st; + char_u *esc_name = NULL; #ifdef FEAT_BROWSE if (cmdmod.browse) @@ -935,11 +936,14 @@ ex_diffpatch(exarg_T *eap) /* Get the absolute path of the patchfile, changing directory below. */ fullname = FullName_save(eap->arg, FALSE); #endif - buflen = STRLEN(tmp_orig) + ( + esc_name = vim_strsave_shellescape( # ifdef UNIX - fullname != NULL ? STRLEN(fullname) : + fullname != NULL ? fullname : # endif - STRLEN(eap->arg)) + STRLEN(tmp_new) + 16; + eap->arg, TRUE, TRUE); + if (esc_name == NULL) + goto theend; + buflen = STRLEN(tmp_orig) + STRLEN(esc_name) + STRLEN(tmp_new) + 16; buf = alloc((unsigned)buflen); if (buf == NULL) goto theend; @@ -977,17 +981,8 @@ ex_diffpatch(exarg_T *eap) { /* Build the patch command and execute it. Ignore errors. Switch to * cooked mode to allow the user to respond to prompts. */ - vim_snprintf((char *)buf, buflen, -#ifdef UNIX - "patch -o %s %s < '%s'", -#else - "patch -o %s %s < \"%s\"", -#endif - tmp_new, tmp_orig, -# ifdef UNIX - fullname != NULL ? fullname : -# endif - eap->arg); + vim_snprintf((char *)buf, buflen, "patch -o %s %s < %s", + tmp_new, tmp_orig, esc_name); #ifdef FEAT_AUTOCMD block_autocmds(); /* Avoid ShellCmdPost stuff */ #endif @@ -1078,6 +1073,7 @@ theend: #ifdef UNIX vim_free(fullname); #endif + vim_free(esc_name); #ifdef FEAT_BROWSE vim_free(browseFile); cmdmod.browse = browse_flag; diff --git a/src/os_unix.c b/src/os_unix.c index c451e899ae..1ae9b3c6ff 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3083,7 +3083,7 @@ executable_file(char_u *name) } /* - * Return 1 if "name" can be found in $PATH and executed, 0 if not. + * Return TRUE if "name" can be found in $PATH and executed, FALSE if not. * If "use_path" is FALSE only check if "name" is executable. * Return -1 if unknown. */ @@ -5451,8 +5451,10 @@ mch_stop_job(job_T *job, char_u *how) /* TODO: have an option to only kill the process, not the group? */ job_pid = job->jv_pid; +#ifdef HAVE_GETPGID if (job_pid == getpgid(job_pid)) job_pid = -job_pid; +#endif kill(job_pid, sig); diff --git a/src/testdir/test3.in b/src/testdir/test3.in index 9e66436e7d..c78a66ec13 100644 --- a/src/testdir/test3.in +++ b/src/testdir/test3.in @@ -970,7 +970,8 @@ break; /* end of AUTO */ STARTTEST -:set tw=0 wm=60 columns=80 noai fo=croq +:set tw=0 noai fo=croq +:let &wm = &columns - 20 /serious/e a about life, the universe, and the rest ENDTEST diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim index c23e8a1da5..e09bcaa44f 100644 --- a/src/testdir/test_diffmode.vim +++ b/src/testdir/test_diffmode.vim @@ -319,7 +319,7 @@ func Test_diffpatch() new call assert_fails('diffpatch Xpatch', 'E816:') - for name in ['Xpatch', 'Xpatch$HOME'] + for name in ['Xpatch', 'Xpatch$HOME', 'Xpa''tch'] call setline(1, ['1', '2', '3']) if name != 'Xpatch' call rename('Xpatch', name) diff --git a/src/version.c b/src/version.c index 99f7e8b034..d3a72a086f 100644 --- a/src/version.c +++ b/src/version.c @@ -779,6 +779,12 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 445, +/**/ + 444, +/**/ + 443, /**/ 442, /**/