Basti Grembowietz wrote:
> Hi vim-developers!
>
> I have a small bug-report with including fix.
>
> WHAT:
> On my home PC the saving of a file always raised two E54 warnings.
> Yesterday this was annoying to much (having to press some key before
> working on normally, so I investigated a bit. And fixed it =) Open
> source is nice.
>
> It showed up that my chosen username in Windows XP was the cause of
> these warnings - it is "(rax)". This implies that my temporary
> directory is located at "C:\DOKUME~1\(rax)\LOKALE~1\Temp\". And that
> was the reason for these E54 warnings.
>
> E54 means "unmatched bracket (". Usually backslashes will be
> replaced by [\/] when they are allowed as means to describe paths.
>
> WHERE IT HAPPENS IN THE SOURCE:
>
> While saving, there are some paths added (for a purpose I do not see /
> but also do not need in this context):
>
> fileio.c!buf_write():
> 3238 #ifdef FEAT_WILDIGN
> 3239 if (dobackup && *p_bsk != NUL && match_file_list(p_bsk, sfname,
> ffname))
> 3240 dobackup = FALSE;
> 3241 #endif
>
> p_bsk was set to
> "C:\DOKUME~1\(rax)\LOKALE~1\Temp\*,C:\DOKUME~1\(rax)\LOKALE~1\Temp\*"
>
> This goes then to fileio.c!match_file_list(), then to
> fileio.c!file_pat_to_reg_pat() - and there is the bug.
>
> WANTED BEHAVIOUR:
> file_pat_to_reg_pat should convert
> "C:\DOKUME~1\(rax)\LOKALE~1\Temp\" to
> "^C:[\/]DOKUME\~1[\/](rax)[\/]LOKALE\~1[\/]Temp[\/]"
>
> CURRENT BEHAVIOUR:
> file_pat_to_reg_pat converts
> "C:\DOKUME~1\(rax)\LOKALE~1\Temp\" to
> "^C:[\/]DOKUME\~1\(rax)[\/]LOKALE\~1[\/]Temp[\/]"
>
>
> THE FIX
> change
>
> fileio.cpp!file_pat_to_reg_pat()
> 9368 if ((vim_isfilec(p[1]) || p[1] == '*' || p[1] == '?' )
> 9369 && p[1] != '+')
>
> to this:
>
> fileio.cpp!file_pat_to_reg_pat()
> 9368 if ((vim_isfilec(p[1]) || p[1] == '*' || p[1] == '?' || p[1] ==
> '(' )
> 9369 && p[1] != '+')
I'm glad you managed to figure out the problem and suggest a patch.
However, I think this is the wrong place to fix it. The "\(" in
'backupskip' must be seen as a special item in the pattern, after all it
is a list of patterns and "\(" is a regexp item.
We better make sure that when there are special things in $TEMP they are
escaped when put in 'backupskip'. So that $TEMP is taken literally.
That is in set_init_1(), around line 3000. Perhaps you can make a patch
for that?
> NOTES
> Maybe this behaviour can also be fixed for ')' as first character of a
> directory, as it will raise the same behaviour in VIM.
>
> As I am new to vim-dev, who usually submits this to the repository? Can
> anyone make a cvs/svn/whateveryouuse-account?
You can send patches to me.
--
What is the difference between a professional and an amateur?
The ark was built by an amateur; professionals gave us the Titanic.
/// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///