diff --git a/src/cmdexpand.c b/src/cmdexpand.c index 449636f736..a7a5acf95f 100644 --- a/src/cmdexpand.c +++ b/src/cmdexpand.c @@ -3718,8 +3718,9 @@ ExpandGenericExt( */ static void expand_shellcmd_onedir( - char_u *pat, - size_t pathlen, // length of the path portion of pat. + char_u *pathed_pattern, // fully pathed pattern + size_t pathlen, // length of the path portion of pathed_pattern + // (0 if no path). char_u ***matches, int *numMatches, int flags, @@ -3727,7 +3728,7 @@ expand_shellcmd_onedir( garray_T *gap) { // Expand matches in one directory of $PATH. - if (expand_wildcards(1, &pat, numMatches, matches, flags) != OK) + if (expand_wildcards(1, &pathed_pattern, numMatches, matches, flags) != OK) return; if (ga_grow(gap, *numMatches) == FAIL) @@ -3878,6 +3879,9 @@ expand_shellcmd( seplen = !after_pathsep(s, e) ? STRLEN_LITERAL(PATHSEPSTR) : 0; } + // Make sure that the pathed pattern (ie the path and pattern concatenated + // together) will fit inside the buffer. If not skip it and move on to the + // next path. if (pathlen + seplen + patlen + 1 <= MAXPATHL) { if (pathlen > 0) diff --git a/src/version.c b/src/version.c index 7297bc8cc2..c7027a68ea 100644 --- a/src/version.c +++ b/src/version.c @@ -719,6 +719,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1570, /**/ 1569, /**/