From 38a3d6c9601b637a28f399059263300e9f65eba4 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 11 Mar 2017 18:42:56 +0100 Subject: [PATCH 1/3] patch 8.0.0443: terminal width is set to 80 in test3 Problem: Terminal width is set to 80 in test3. Solution: Instead of setting 'columns' set 'wrapmargin' depending on 'columns. --- src/testdir/test3.in | 3 ++- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) 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/version.c b/src/version.c index 0f7b4e499f..5a58f4317c 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 443, /**/ 442, /**/ From a95ab321200f0239991bf53756b17cd7b90745f9 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 11 Mar 2017 19:21:53 +0100 Subject: [PATCH 2/3] patch 8.0.0444: diffpatch fails when the file name has a quote Problem: Diffpatch fails when the file name has a quote. Solution: Escape the name properly. (zetzei) --- src/diff.c | 24 ++++++++++-------------- src/testdir/test_diffmode.vim | 2 +- src/version.c | 2 ++ 3 files changed, 13 insertions(+), 15 deletions(-) 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/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 5a58f4317c..db00cc7d23 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 444, /**/ 443, /**/ From 2fcf6688bc3a8df2dff9c352d415b89db8b33668 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 11 Mar 2017 20:03:42 +0100 Subject: [PATCH 3/3] patch 8.0.0445: getpgid is not supported on all systems Problem: Getpgid is not supported on all systems. Solution: Add a configure check. --- src/auto/configure | 2 +- src/config.h.in | 5 +++-- src/configure.ac | 2 +- src/os_unix.c | 4 +++- src/version.c | 2 ++ 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/auto/configure b/src/auto/configure index 34770f8baf..73b9ce7d56 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -12022,7 +12022,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 113fad1d21..4445cf5bfe 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -3609,7 +3609,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/os_unix.c b/src/os_unix.c index 6c5955b84f..9dd5c34e7c 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3081,7 +3081,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. */ @@ -5429,8 +5429,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/version.c b/src/version.c index db00cc7d23..7a0d500b47 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 445, /**/ 444, /**/