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

[patch] can't cd to an unc path (win)

Expand Messages
  • Christian Brabandt
    Bram, I noticed since some versions, one cannot do ... anymore. It aborts with something like E344: Can t find directory foobar share in cdpath I tracked it
    Message 1 of 3 , Nov 19, 2013
      Bram,
      I noticed since some versions, one cannot do
      :cd \\foobar\share
      anymore. It aborts with something like
      E344: Can't find directory \\foobar\share in cdpath

      I tracked it down to patch 7.3.1182

      Here is a patch, please include.

      regards,
      Christian
      --
      Was man mit Gewalt gewinnt, kann man nur mit Gewalt behalten.
      -- Mahatma Gandhi

      --
      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Bram Moolenaar
      ... Why the checks for NUL? Looks like you can just leave them out. -- Are leaders born or made? And if they re made, can we return them under warranty?
      Message 2 of 3 , Nov 20, 2013
        Christian Brabandt wrote:

        > Bram,
        > I noticed since some versions, one cannot do
        > :cd \\foobar\share
        > anymore. It aborts with something like
        > E344: Can't find directory \\foobar\share in cdpath
        >
        > I tracked it down to patch 7.3.1182
        >
        > Here is a patch, please include.


        > diff -r 58bcf8fa172f src/os_win32.c
        > --- a/src/os_win32.c Sun Nov 17 20:32:54 2013 +0100
        > +++ b/src/os_win32.c Tue Nov 19 21:29:57 2013 +0100
        > @@ -2851,6 +2851,12 @@
        > struct stat st;
        > int n;
        >
        > + if (name[0] != NUL &&
        > + name[0] == '\\' &&
        > + name[1] != NUL &&
        > + name[1] == '\\')
        > + /* UNC path */
        > + return win32_getattrs(name);
        > n = mch_stat(name, &st);
        > return n == 0 ? (int)st.st_mode : -1;
        > }

        Why the checks for NUL? Looks like you can just leave them out.

        --
        Are leaders born or made? And if they're made, can we return them under
        warranty?
        (Scott Adams - The Dilbert principle)

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ an exciting new programming language -- http://www.Zimbu.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --
        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Christian Brabandt
        Hi Bram! ... Yeah, you can probably leave that out. Best, Christian -- -- You received this message from the vim_dev maillist. Do not top-post! Type your
        Message 3 of 3 , Nov 20, 2013
          Hi Bram!

          On Mi, 20 Nov 2013, Bram Moolenaar wrote:

          > Christian Brabandt wrote:
          >
          > > Bram,
          > > I noticed since some versions, one cannot do
          > > :cd \\foobar\share
          > > anymore. It aborts with something like
          > > E344: Can't find directory \\foobar\share in cdpath
          > >
          > > I tracked it down to patch 7.3.1182
          > >
          > > Here is a patch, please include.
          >
          >
          > > diff -r 58bcf8fa172f src/os_win32.c
          > > --- a/src/os_win32.c Sun Nov 17 20:32:54 2013 +0100
          > > +++ b/src/os_win32.c Tue Nov 19 21:29:57 2013 +0100
          > > @@ -2851,6 +2851,12 @@
          > > struct stat st;
          > > int n;
          > >
          > > + if (name[0] != NUL &&
          > > + name[0] == '\\' &&
          > > + name[1] != NUL &&
          > > + name[1] == '\\')
          > > + /* UNC path */
          > > + return win32_getattrs(name);
          > > n = mch_stat(name, &st);
          > > return n == 0 ? (int)st.st_mode : -1;
          > > }
          >
          > Why the checks for NUL? Looks like you can just leave them out.

          Yeah, you can probably leave that out.

          Best,
          Christian

          --
          --
          You received this message from the "vim_dev" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_dev" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        Your message has been successfully submitted and would be delivered to recipients shortly.