]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0460: did_set_shellpipe_redir() in wrong file v9.2.0460
authorzeertzjq <zeertzjq@outlook.com>
Sat, 9 May 2026 14:18:53 +0000 (14:18 +0000)
committerChristian Brabandt <cb@256bit.org>
Sat, 9 May 2026 14:22:47 +0000 (14:22 +0000)
Problem:  did_set_shellpipe_redir() is a callback for a string option,
          but is not in optionstr.c (after 9.2.0458).
Solution: Move it to optionstr.c. Also add missing change from patch
          9.2.0455 (zeertzjq).

related: #20159
related: #20164
closes:  #20170

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/cmdexpand.c
src/option.c
src/optionstr.c
src/proto/option.pro
src/proto/optionstr.pro
src/version.c

index 3c660b5ea25a1e2eaa9d838238922a421e7e7e9a..f3139819849a534665dfbdb03c22e76ec695de57 100644 (file)
@@ -4183,7 +4183,7 @@ expand_process_user_list(
        {
            if (tv->vval.v_string == NULL)
                continue;  // Skip NULL strings
-           p = vim_strsave(li->li_tv.vval.v_string);
+           p = vim_strsave(tv->vval.v_string);
        }
        else if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL)
        {
index 426e58e29b6bc4c1d201b579e8a53f51da72c75a..4197d4d8b7958b955702f0a3ccfac1eebb813d9d 100644 (file)
@@ -4527,44 +4527,6 @@ did_set_maxsearchcount(optset_T *args UNUSED)
 #undef MAX_SEARCH_COUNT
 }
 
-/*
- * Validate 'shellpipe'/'shellredir' option.
- */
-    char *
-did_set_shellpipe_redir(optset_T *args)
-{
-    char_u     *p;
-    bool       seen = false;
-
-    for (p = args->os_newval.string; *p != NUL; ++p)
-    {
-       if (*p != '%')
-           continue;
-
-       if (p[1] == NUL)
-           return e_invalid_format_string_single_percent_s;
-
-       if (p[1] == '%')
-       {
-           ++p;    // skip second %
-           continue;
-       }
-
-       if (p[1] == 's')
-       {
-           if (seen)
-               return e_invalid_format_string_single_percent_s;
-
-           seen = true;
-           ++p;    // consume 's'
-           continue;
-       }
-       return e_invalid_format_string_single_percent_s;
-    }
-    return NULL;
-}
-
-
 #if defined(BACKSLASH_IN_FILENAME)
 /*
  * Process the updated 'shellslash' option value.
index 59d490913059512079feab1eeb7619603885628f..b60e595868ba2a2a21d5789ece4cf4d3a2ae4668 100644 (file)
@@ -4179,6 +4179,43 @@ expand_set_sessionoptions(
 }
 #endif
 
+/*
+ * Validate 'shellpipe'/'shellredir' option.
+ */
+    char *
+did_set_shellpipe_redir(optset_T *args)
+{
+    char_u     *p;
+    bool       seen = false;
+
+    for (p = args->os_newval.string; *p != NUL; ++p)
+    {
+       if (*p != '%')
+           continue;
+
+       if (p[1] == NUL)
+           return e_invalid_format_string_single_percent_s;
+
+       if (p[1] == '%')
+       {
+           ++p;    // skip second %
+           continue;
+       }
+
+       if (p[1] == 's')
+       {
+           if (seen)
+               return e_invalid_format_string_single_percent_s;
+
+           seen = true;
+           ++p;    // consume 's'
+           continue;
+       }
+       return e_invalid_format_string_single_percent_s;
+    }
+    return NULL;
+}
+
 /*
  * The 'shortmess' option is changed.
  */
index ad8c9043ab237c8e8fba77d8bedf5eed494774e6..ae586ea9787d813873b5681a0414d0bb9e2f8aa2 100644 (file)
@@ -65,7 +65,6 @@ char *did_set_pyxversion(optset_T *args);
 char *did_set_readonly(optset_T *args);
 char *did_set_scrollbind(optset_T *args);
 char *did_set_maxsearchcount(optset_T *args);
-char *did_set_shellpipe_redir(optset_T *args);
 char *did_set_shellslash(optset_T *args);
 char *did_set_shiftwidth_tabstop(optset_T *args);
 char *did_set_showtabline(optset_T *args);
index cb174e73c0f4aee1e294443f392bd9c3e448f099..c8a8b12ff52e59fea0d1d14cc2543f0b31e6b36f 100644 (file)
@@ -152,6 +152,7 @@ char *did_set_selectmode(optset_T *args);
 int expand_set_selectmode(optexpand_T *args, int *numMatches, char_u ***matches);
 char *did_set_sessionoptions(optset_T *args);
 int expand_set_sessionoptions(optexpand_T *args, int *numMatches, char_u ***matches);
+char *did_set_shellpipe_redir(optset_T *args);
 char *did_set_shortmess(optset_T *args);
 int expand_set_shortmess(optexpand_T *args, int *numMatches, char_u ***matches);
 char *did_set_showbreak(optset_T *args);
index 5ffa63f7fee7b0a3a027c515f0e10f6ab9c791fd..6ac372ac5d6038dda71ed0f2bab49f7a848f16c4 100644 (file)
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    460,
 /**/
     459,
 /**/