Bram Moolenaar wrote: > > Bill McCarthy wrote: > >>>> On Sun 23-Sep-07 8:34pm -0600, Dasn wrote: >>>> >>>>> I've posted on vim_use some days before: >>>>> >>>>>> $ vim -c "q" 'foo ~ foo' >>>>>> $ vim -c "normal '0" >>>>>> E20: Mark not set >>>>> Filename contains '~' character which is around with path separators >>>>> (i.e. ' ' and ',') has such problem. >>>>> >>>>> And the patch: >>>>> >>>>> Index: mark.c >>>> With Windows (using XP) the problem is far nastier. Simply >>>> opening a file with that name: >>>> >>>> gvim "foo ~ foo" >>>> >>>> causes problems. Specifically, I receive the following >>>> message: >>>> >>>> E303: Unable to open swap file for "foo C:\Documents and Settings\Bill >>>> foo", >>>> recovery impossible >>>> >>>> Notice how the '~' is expanded. >>>> >>>> In my environment: >>>> >>>> HOMEDRIVE=C: >>>> HOMEPATH=\Documents and Settings\Bill >>> With MS-Windows the wildcard expansion is done by Vim, not by the shell. >>> The shell does remove the double quotes. This results in ~ to be >>> expanded. Try putting a backslash before it. >> Good idea, but: gvim "foo \~ foo" >> results in: >> >> E303: Unable to open swap file for "foo \~ foo", recovery impossible >> >> and modifying the file and trying to write results in: >> >> "foo \~ foo" E212: Can't open file for writing > > I see the problem. Since "~" is a filename character the backslash > before it isn't removed, it's assumed to be a path separator. > > I think we should fix this by avoiding the ~ to be expanded. >
Maybe expand it only if the file name starts with tilde + path separator? (IIRC, ~user is not expanded on Windows). Best regards, Tony. -- After all, what is your hosts' purpose in having a party? Surely not for you to enjoy yourself; if that were their sole purpose, they'd have simply sent champagne and women over to your place by taxi. -- P. J. O'Rourke --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---