patch 9.1.1715: Some functions need to be re-ordered Commit: https://github.com/vim/vim/commit/7292964267bc6d7a3b6a1637405359e2586e00f2 Author: Hirohito Higashi <h.east....@gmail.com> Date: Sun Aug 31 18:52:32 2025 +0200
patch 9.1.1715: Some functions need to be re-ordered Problem: Some functions need to be re-ordered Solution: Re-order and move functions around favoring mch_*() functions inside os_*.c files, Change scope of dos_expandpath() to global instead of static (Hirohito Higashi) The following fixes and tweaks have been made: - Moved the definition of mch_expandpath() from filepath.c to os_win32.c in MS-Windows builds (essentially, the mch_~() function should be defined in os_~.c.) - In accordance with the above, the scope of dos_expandpath() has been changed from static to global. - Other miscellaneous changes. closes: #18176 Signed-off-by: Hirohito Higashi <h.east....@gmail.com> Signed-off-by: Christian Brabandt <c...@256bit.org> diff --git a/src/filepath.c b/src/filepath.c index d8a1dce74..0048fab59 100644 --- a/src/filepath.c +++ b/src/filepath.c @@ -3523,7 +3523,7 @@ pstrcmp(const void *a, const void *b) * Return the number of matches found. * NOTE: much of this is identical to unix_expandpath(), keep in sync! */ - static int + int dos_expandpath( garray_T *gap, char_u *path, @@ -3751,15 +3751,6 @@ dos_expandpath( sizeof(char_u *), pstrcmp); return matches; } - - int -mch_expandpath( - garray_T *gap, - char_u *path, - int flags) // EW_* flags -{ - return dos_expandpath(gap, path, 0, flags, FALSE); -} #endif // MSWIN #if (defined(UNIX) && !defined(VMS)) || defined(USE_UNIXFILENAME) \ diff --git a/src/os_win32.c b/src/os_win32.c index 056a5a223..3873a2b37 100644 --- a/src/os_win32.c +++ b/src/os_win32.c @@ -7698,6 +7698,21 @@ mch_total_mem(int special UNUSED) return (long_u)((ms.ullTotalPhys - WINNT_RESERVE_BYTES) / 1024); } +/* + * Expand a path into all matching files and/or directories. Handles "*", + * "?", "[a-z]", "**", etc. + * "path" has backslashes before chars that are not to be expanded. + * Returns the number of matches found. + */ + int +mch_expandpath( + garray_T *gap, + char_u *path, + int flags) // EW_* flags +{ + return dos_expandpath(gap, path, 0, flags, FALSE); +} + /* * mch_wrename() works around a bug in rename (aka MoveFile) in * Windows, the bug can be demonstrated with the following scenario: diff --git a/src/proto/cmdexpand.pro b/src/proto/cmdexpand.pro index ff065145f..388523d6f 100644 --- a/src/proto/cmdexpand.pro +++ b/src/proto/cmdexpand.pro @@ -25,5 +25,5 @@ int wildmenu_process_key(cmdline_info_T *cclp, int key, expand_T *xp); void wildmenu_cleanup(cmdline_info_T *cclp); void f_getcompletion(typval_T *argvars, typval_T *rettv); void f_getcompletiontype(typval_T *argvars, typval_T *rettv); -void f_cmdcomplete_info(typval_T *argvars UNUSED, typval_T *rettv); +void f_cmdcomplete_info(typval_T *argvars, typval_T *rettv); /* vim: set ft=c : */ diff --git a/src/proto/filepath.pro b/src/proto/filepath.pro index 668662115..d82652ce7 100644 --- a/src/proto/filepath.pro +++ b/src/proto/filepath.pro @@ -55,6 +55,7 @@ int vim_fexists(char_u *fname); int expand_wildcards_eval(char_u **pat, int *num_file, char_u ***file, int flags); int expand_wildcards(int num_pat, char_u **pat, int *num_files, char_u ***files, int flags); int match_suffix(char_u *fname); +int dos_expandpath(garray_T *gap, char_u *path, size_t wildoff, int flags, int didstar); int unix_expandpath(garray_T *gap, char_u *path, size_t wildoff, int flags, int didstar); int gen_expand_wildcards(int num_pat, char_u **pat, int *num_file, char_u ***file, int flags); void addfile(garray_T *gap, char_u *f, int flags); diff --git a/src/proto/if_xcmdsrv.pro b/src/proto/if_xcmdsrv.pro index 801dc00e0..74245b75a 100644 --- a/src/proto/if_xcmdsrv.pro +++ b/src/proto/if_xcmdsrv.pro @@ -1,7 +1,7 @@ /* if_xcmdsrv.c */ int serverRegisterName(Display *dpy, char_u *name); void serverChangeRegisteredWindow(Display *dpy, Window newwin); -int serverSendToVim(Display *dpy, char_u *name, char_u *cmd, char_u **result, Window *server, int asExpr, int timeout, int localLoop, int silent); +int serverSendToVim(Display *dpy, char_u *name, char_u *cmd, char_u **result, Window *server, Bool asExpr, int timeout, Bool localLoop, int silent); char_u *serverGetVimNames(Display *dpy); Window serverStrToWin(char_u *str); int serverSendReply(char_u *name, char_u *str); diff --git a/src/proto/os_win32.pro b/src/proto/os_win32.pro index cb8458531..c84e308ac 100644 --- a/src/proto/os_win32.pro +++ b/src/proto/os_win32.pro @@ -61,6 +61,7 @@ void mch_delay(long msec, int flags); int mch_remove(char_u *name); void mch_breakcheck(int force); long_u mch_total_mem(int special); +int mch_expandpath(garray_T *gap, char_u *path, int flags); int mch_wrename(WCHAR *wold, WCHAR *wnew); int mch_rename(const char *pszOldFile, const char *pszNewFile); char *default_shell(void); diff --git a/src/proto/typval.pro b/src/proto/typval.pro index 05283a173..2080a262c 100644 --- a/src/proto/typval.pro +++ b/src/proto/typval.pro @@ -67,8 +67,8 @@ char_u *tv_get_string_buf_chk_strict(typval_T *varp, char_u *buf, int strict); char_u *tv_stringify(typval_T *varp, char_u *buf); int tv_check_lock(typval_T *tv, char_u *name, int use_gettext); void copy_tv(typval_T *from, typval_T *to); -int typval_compare(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic); int typval_compare2(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic, int *res); +int typval_compare(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic); int typval_compare_list(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic, int *res); int typval_compare_tuple(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic, int *res); int typval_compare_null(typval_T *tv1, typval_T *tv2); diff --git a/src/version.c b/src/version.c index aa70f4c25..b700067fc 100644 --- a/src/version.c +++ b/src/version.c @@ -724,6 +724,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1715, /**/ 1714, /**/ -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1uslPV-00DW57-Df%40256bit.org.