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

Re: patchmode truncates filename [carbon vim 6.1.184]

Expand Messages
  • Benji Fisher
    ... I see the same problem on Mac OSX. Yes, it only happens with long file names. Unless someone can reproduce this on another system, let s follow up on
    Message 1 of 9 , Nov 6, 2002
    • 0 Attachment
      Piet Delport wrote:

      > On Tue, 05 Nov 2002 at 11:29:59 -0500, R. Edward Ralston wrote:
      >
      > >"patchmode" appears to be munging long filenames.
      > >
      > >In your shell do:
      > >
      > > touch ABCDEFGHIJKLMNOPQRSTUVWXYZ.txt
      > >
      > >then
      > >
      > > vim -u NONE -U NONE ABCDEFGHIJKLMNOPQRSTUVWXYZ.txt
      > >
      > >once there, type some text, then
      > >
      > > :set patchmode=.originalfile
      > > :wq
      > >
      > >I then have the two files
      > >
      > > ABCDEFGHIJKLMNOPQRSTUVWXYZ.txt
      > > ABCDEFGHIJKLMNOPQRSTUVWXYZ.originalfile
      > >
      > >in the current directory.
      > >Shouln't that instead be
      > >
      > > ABCDEFGHIJKLMNOPQRSTUVWXYZ.txt.originalfile
      > >
      > >???
      >
      >
      > I get the expected (latter) result here (FreeBSD, Vim 6.1, see the
      > message i posted just yesterday for my :ver).
      >
      >
      > >:ver
      > >VIM - Vi IMproved 6.1 (2002 Mar 24, compiled 09/23/02 08:30:39)
      > >MacOS X (unix) version
      >
      > [snip]
      >
      > From the way the extension gets munged, maybe MacOS X is responsible?
      > Does it only happen with "long" filenames?

      I see the same problem on Mac OSX. Yes, it only happens with long
      file names. Unless someone can reproduce this on another system, let's
      follow up on vim-mac but not vim-dev.

      --Benji Fisher
    • R. Edward Ralston
      Looks like a problem only on MacOSX, specifically with vim compiled with the Carbon GUI. I compiled different versions of vim 6.1.200: RH Linux 7.2 (with GTK
      Message 2 of 9 , Nov 6, 2002
      • 0 Attachment
        Looks like a problem only on MacOSX, specifically with
        vim compiled with the Carbon GUI.

        I compiled different versions of vim 6.1.200:

        RH Linux 7.2 (with GTK GUI): ok
        MacOSX (without GUI): ok
        MacOSX (with Carbon GUI): NOT OK

        Strange that the problem exhibits itself in the
        version compiled with the Carbon GUI, but not in the
        version without.

        Even if I run the (with Carbon GUI) version from
        within Terminal.app, I get the weird truncation
        error.

        -e


        On 2002-11-06 14:43:27, Benji Fisher <benji@...> wrote:
        > Piet Delport wrote:
        >
        > >On Tue, 05 Nov 2002 at 11:29:59 -0500, R. Edward Ralston wrote:
        > >
        > >>"patchmode" appears to be munging long filenames.
        > >>
        > >>In your shell do:
        > >>
        > >> touch ABCDEFGHIJKLMNOPQRSTUVWXYZ.txt
        > >>
        > >>then
        > >>
        > >> vim -u NONE -U NONE ABCDEFGHIJKLMNOPQRSTUVWXYZ.txt
        > >>
        > >>once there, type some text, then
        > >>
        > >> :set patchmode=.originalfile
        > >> :wq
        > >>
        > >>I then have the two files
        > >>
        > >> ABCDEFGHIJKLMNOPQRSTUVWXYZ.txt
        > >> ABCDEFGHIJKLMNOPQRSTUVWXYZ.originalfile
        > >>
        > >>in the current directory.
        > >>Shouln't that instead be
        > >>
        > >> ABCDEFGHIJKLMNOPQRSTUVWXYZ.txt.originalfile
        > >>
        > >>???
        > >
        > >
        > >I get the expected (latter) result here (FreeBSD, Vim 6.1, see the
        > >message i posted just yesterday for my :ver).
        > >
        > >
        > >>:ver
        > >>VIM - Vi IMproved 6.1 (2002 Mar 24, compiled 09/23/02 08:30:39)
        > >>MacOS X (unix) version
        > >
        > >[snip]
        > >
        > >From the way the extension gets munged, maybe MacOS X is responsible?
        > >Does it only happen with "long" filenames?
        >
        > I see the same problem on Mac OSX. Yes, it only happens with long
        > file names. Unless someone can reproduce this on another system, let's
        > follow up on vim-mac but not vim-dev.
        >
        > --Benji Fisher

        --
        R. Edward Ralston <eralston@...>
        I'm going to live forever; or die trying.
      • R. Edward Ralston
        The following patch fixes a problem with patchmode truncating long filenames on MacOSX built with the Carbon GUI. This patch is against vim 6.1.255 ######
        Message 3 of 9 , Nov 13, 2002
        • 0 Attachment
          The following patch fixes a problem with 'patchmode'
          truncating long filenames on MacOSX built
          with the Carbon GUI.

          This patch is against vim 6.1.255


          ###### snip ######
          diff -C3 -r src.orig/os_mac.h src/os_mac.h
          *** src.orig/os_mac.h Sat Mar 9 10:17:30 2002
          --- src/os_mac.h Wed Nov 13 09:01:52 2002
          ***************
          *** 310,318 ****
          */
          #define CMDBUFFSIZE 1024 /* size of the command processing buffer */

          ! #define MAXPATHL 256 /* Limited by the Pascal Strings */
          !
          ! #define BASENAMELEN (32-5-1) /* length of base of filename */

          #ifndef DFLT_MAXMEM
          # define DFLT_MAXMEM 512 /* use up to 512 Kbyte for buffer */
          --- 310,322 ----
          */
          #define CMDBUFFSIZE 1024 /* size of the command processing buffer */

          ! #if defined(MACOS_X_UNIX)
          ! # define MAXPATHL 1024
          ! # define BASENAMELEN (MAXNAMLEN - 5) /* length of base of filename */
          ! #else
          ! # define MAXPATHL 256 /* Limited by the Pascal Strings */
          ! # define BASENAMELEN (32-5-1) /* length of base of filename */
          ! #endif

          #ifndef DFLT_MAXMEM
          # define DFLT_MAXMEM 512 /* use up to 512 Kbyte for buffer */
          ###### snip ######



          On 2002-11-05 11:29:59, R. Edward Ralston <eralston@...> wrote:
          > "patchmode" appears to be munging long filenames.
          >
          > In your shell do:
          >
          > touch ABCDEFGHIJKLMNOPQRSTUVWXYZ.txt
          >
          > then
          >
          > vim -u NONE -U NONE ABCDEFGHIJKLMNOPQRSTUVWXYZ.txt
          >
          > once there, type some text, then
          >
          > :set patchmode=.originalfile
          > :wq
          >
          > I then have the two files
          >
          > ABCDEFGHIJKLMNOPQRSTUVWXYZ.txt
          > ABCDEFGHIJKLMNOPQRSTUVWXYZ.originalfile
          >
          > in the current directory.
          > Shouln't that instead be
          >
          > ABCDEFGHIJKLMNOPQRSTUVWXYZ.txt.originalfile
          >
          > ???
          >
          > Thanks.
          >


          --
          do daemons dream of electric sleep()?
          R. Edward Ralston <eralston@...>
        • Benji Fisher
          ... [snip] ... Thank you! If this patch works for me, I will post new binaries soon. (It has been a while...) What is the logic behind the definition of
          Message 4 of 9 , Nov 13, 2002
          • 0 Attachment
            R. Edward Ralston wrote:
            > The following patch fixes a problem with 'patchmode'
            > truncating long filenames on MacOSX built
            > with the Carbon GUI.
            >
            > This patch is against vim 6.1.255
            >
            [snip]
            > --- 310,322 ----
            > */
            > #define CMDBUFFSIZE 1024 /* size of the command processing buffer */
            >
            > ! #if defined(MACOS_X_UNIX)
            > ! # define MAXPATHL 1024
            > ! # define BASENAMELEN (MAXNAMLEN - 5) /* length of base of filename */
            > ! #else
            > ! # define MAXPATHL 256 /* Limited by the Pascal Strings */
            > ! # define BASENAMELEN (32-5-1) /* length of base of filename */
            > ! #endif
            >
            > #ifndef DFLT_MAXMEM
            > # define DFLT_MAXMEM 512 /* use up to 512 Kbyte for buffer */
            > ###### snip ######

            Thank you! If this patch works for me, I will post new binaries
            soon. (It has been a while...) What is the logic behind the definition
            of BASENAMELEN ? I assume -5 is to allow for the extension; it that
            guaranteed to be enough? Do we not need -1 for the "."?

            --Benji Fisher
          • R. Edward Ralston
            ... I think that the -5 isn t for the extension, but instead is used when the leading . and trailing .swp are added to create the associated swap
            Message 5 of 9 , Nov 13, 2002
            • 0 Attachment
              On 2002-11-13 09:55:22, Benji Fisher <benji@...> wrote:
              > Thank you! If this patch works for me, I will post new
              > binaries soon. (It has been a while...) What is the logic
              > behind the definition of BASENAMELEN ? I assume -5 is to allow
              > for the extension; it that guaranteed to be enough? Do we not
              > need -1 for the "."?
              >
              > --Benji Fisher


              I think that the "-5" isn't for the extension, but instead
              is used when the leading "." and trailing ".swp" are added
              to create the associated swap filename.

              -e


              --
              R. Edward Ralston <eralston@...>
              Experience is what allows you to recognize a mistake the second time
              you make it.
            • Bram Moolenaar
              ... Thanks, I ll include it. -- How To Keep A Healthy Level Of Insanity: 11. Specify that your drive-through order is to go . /// Bram Moolenaar --
              Message 6 of 9 , Nov 13, 2002
              • 0 Attachment
                Ed Ralston wrote:

                > The following patch fixes a problem with 'patchmode'
                > truncating long filenames on MacOSX built
                > with the Carbon GUI.

                Thanks, I'll include it.

                --
                How To Keep A Healthy Level Of Insanity:
                11. Specify that your drive-through order is "to go".

                /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
                /// Creator of Vim - Vi IMproved -- http://www.vim.org \\\
                \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
                \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///
              • Benji Fisher
                ... Sorry, I have lost some of my e-mail. I saved the patch, though, and tried it out. I do not have time to explore this more right now, but here is the
                Message 7 of 9 , Nov 17, 2002
                • 0 Attachment
                  >>> On Tue, 05 Nov 2002 at 11:29:59 -0500, R. Edward Ralston wrote:
                  >>>
                  >>>> "patchmode" appears to be munging long filenames.
                  >>>>
                  >>>> In your shell do:
                  >>>>
                  >>>> touch ABCDEFGHIJKLMNOPQRSTUVWXYZ.txt
                  >>>>
                  >>>> then
                  >>>>
                  >>>> vim -u NONE -U NONE ABCDEFGHIJKLMNOPQRSTUVWXYZ.txt
                  >>>>
                  >>>> once there, type some text, then
                  >>>>
                  >>>> :set patchmode=.originalfile
                  >>>> :wq

                  Sorry, I have lost some of my e-mail. I saved the patch, though,
                  and tried it out. I do not have time to explore this more right now,
                  but here is the strange output of
                  :let @* = system("ls") :

                  abcdefghijklmnopqrstuvwxyz.originalfile
                  abcdefghijklmnopqrstuvwxyz.txt
                  fjdskanffnhjakfbnjsdakvnjf.originalfile
                  fjdskanffnhjakfbnjsdakvnjfgnrjwvnjfkanvjksad.txt

                  More strangeness: when I simply do

                  :ls

                  many of the longer files are not listed.

                  Details: I got this lovely collection if files by doing

                  :set patchmode=.originalfile
                  :e abc...txt
                  <add a line>
                  :w
                  :e fjd...txt
                  <add a line>
                  :w

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