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] != '+')

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?

Cheers,
Basti

PS: vim rocks.

Attachment: PGP.sig
Description: Signierter Teil der Nachricht

Reply via email to