mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.1.0211: expanding a file name "~" results in $HOME
Problem: Expanding a file name "~" results in $HOME. (Aidan Shafran) Solution: Change "~" to "./~" before expanding. (closes #3072)
This commit is contained in:
13
src/eval.c
13
src/eval.c
@@ -9690,11 +9690,12 @@ shortpath_for_partial(
|
||||
*/
|
||||
int
|
||||
modify_fname(
|
||||
char_u *src, /* string with modifiers */
|
||||
int *usedlen, /* characters after src that are used */
|
||||
char_u **fnamep, /* file name so far */
|
||||
char_u **bufp, /* buffer for allocated file name or NULL */
|
||||
int *fnamelen) /* length of fnamep */
|
||||
char_u *src, // string with modifiers
|
||||
int tilde_file, // "~" is a file name, not $HOME
|
||||
int *usedlen, // characters after src that are used
|
||||
char_u **fnamep, // file name so far
|
||||
char_u **bufp, // buffer for allocated file name or NULL
|
||||
int *fnamelen) // length of fnamep
|
||||
{
|
||||
int valid = 0;
|
||||
char_u *tail;
|
||||
@@ -9724,8 +9725,8 @@ repeat:
|
||||
|| (*fnamep)[1] == '\\'
|
||||
# endif
|
||||
|| (*fnamep)[1] == NUL)
|
||||
|
||||
#endif
|
||||
&& !(tilde_file && (*fnamep)[1] == NUL)
|
||||
)
|
||||
{
|
||||
*fnamep = expand_env_save(*fnamep);
|
||||
|
Reference in New Issue
Block a user