Loading ...
Sorry, an error occurred while loading the content.

Re: [gvim60at win32] '~' or '$' in path of current directory

Expand Messages
  • Bram Moolenaar
    ... The change does fix the problem, but since dos_expandpath() doesn t actually expand the $ , recognizing it as a wildcard is wrong. I ll fix it by adding
    Message 1 of 7 , Sep 1 11:17 AM
    • 0 Attachment
      Martin Horn wrote:

      > > > > I can reproduce it. This is complicated stuff, but it looks like this
      > > > > change will fix the problem. Please try it out.
      > > > [...]
      > > > Works fine for me.
      > > >
      > > > Should '$' be handled the same way? I have tried this:
      > > >
      > > > else if (*path == '*' || *path == '?' || *path == '[' || *path ==
      > '~' ||
      > > > *path == '$')
      > > >
      > > > and it also works for me.
      > >
      > > Is that really needed? What is supposed to happen is that the code that
      > > expands environment variables should take care of "$". Can you give an
      > > example that fails?
      >
      >
      > '$' is a legal character for files and directories under win32
      > (I have tried WinNT / NTFS).
      > 'gf' fails and tags file is not found if I edit e.g. 'c:\12$\abc.c'
      >
      > The change
      > || *path == '$')
      > seem to fix it.
      >
      > :cd $HOME
      > still works.

      The change does fix the problem, but since dos_expandpath() doesn't
      actually expand the "$", recognizing it as a wildcard is wrong. I'll
      fix it by adding mch_has_exp_wildcard(), which only returns TRUE for
      names that can be expanded by mch_expandpath() or dos_expandpath().

      --
      ARTHUR: Shut up! Will you shut up!
      DENNIS: Ah, now we see the violence inherent in the system.
      ARTHUR: Shut up!
      DENNIS: Oh! Come and see the violence inherent in the system!
      HELP! HELP! I'm being repressed!
      The Quest for the Holy Grail (Monty Python)

      /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
      ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
      \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
    • dman
      ... FYI, for another data point, on my Linux system here I can include $ in a filename too. $ touch fo $o $ ls fo* fo$o $ In vim60at I need to escape the $
      Message 2 of 7 , Sep 1 1:31 PM
      • 0 Attachment
        On Sat, Sep 01, 2001 at 08:17:06PM +0200, Bram Moolenaar wrote:
        | Martin Horn wrote:
        |
        | > > > > I can reproduce it. This is complicated stuff, but it looks like this
        | > > > > change will fix the problem. Please try it out.
        | > > > [...]
        | > > > Works fine for me.
        | > > >
        | > > > Should '$' be handled the same way? I have tried this:
        | > > >
        | > > > else if (*path == '*' || *path == '?' || *path == '[' || *path ==
        | > '~' ||
        | > > > *path == '$')
        | > > >
        | > > > and it also works for me.
        | > >
        | > > Is that really needed? What is supposed to happen is that the code that
        | > > expands environment variables should take care of "$". Can you give an
        | > > example that fails?

        FYI, for another data point, on my Linux system here I can include '$'
        in a filename too.

        $ touch fo\$o
        $ ls fo*
        fo$o
        $

        In vim60at I need to escape the '$' in order to open it (with the :e
        command) otherwise it expands $o to the empty string and makes a new
        buffer for "fo".

        -D
      Your message has been successfully submitted and would be delivered to recipients shortly.