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

Patch 6.2f.004

Expand Messages
  • Bram Moolenaar
    Patch 6.2f.004 Problem: vim --version always uses CR/LF in the output. Solution: Omit the CR. Files: src/message.c, src/os_unix.c ...
    Message 1 of 11 , May 26, 2003
    • 0 Attachment
      Patch 6.2f.004
      Problem: "vim --version" always uses CR/LF in the output.
      Solution: Omit the CR.
      Files: src/message.c, src/os_unix.c


      *** ../vim-6.2f.003/src/message.c Mon May 26 22:15:06 2003
      --- src/message.c Mon May 26 20:56:11 2003
      ***************
      *** 1682,1690 ****
      if (!silent_mode)
      {
      p = &buf[0];
      ! /* NL --> CR NL translation (for Unix) */
      /* NL --> CR translation (for Mac) */
      ! if (*s == '\n')
      *p++ = '\r';
      #if defined(USE_CR) && !defined(MACOS_X_UNIX)
      else
      --- 1682,1690 ----
      if (!silent_mode)
      {
      p = &buf[0];
      ! /* NL --> CR NL translation (for Unix, not for "--version") */
      /* NL --> CR translation (for Mac) */
      ! if (*s == '\n' && !info_message)
      *p++ = '\r';
      #if defined(USE_CR) && !defined(MACOS_X_UNIX)
      else
      *** ../vim-6.2f.003/src/os_unix.c Mon May 26 22:15:06 2003
      --- src/os_unix.c Mon May 26 20:57:14 2003
      ***************
      *** 2547,2553 ****
      if (msg_use_printf())
      {
      if (info_message)
      ! mch_msg("\r\n");
      else
      mch_errmsg("\r\n");
      }
      --- 2547,2553 ----
      if (msg_use_printf())
      {
      if (info_message)
      ! mch_msg("\n");
      else
      mch_errmsg("\r\n");
      }
      *** ../vim-6.2f.003/src/version.c Mon May 26 22:56:02 2003
      --- src/version.c Mon May 26 22:57:43 2003
      ***************
      *** 632,633 ****
      --- 632,635 ----
      { /* Add new patch number below this line */
      + /**/
      + 4,
      /**/

      --
      It is too bad that the speed of light hasn't kept pace with the
      changes in CPU speed and network bandwidth. -- <wietse@...>

      /// 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 ///
      \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
    • Bill McCarthy
      ... It doesn t fix the problem reported Sunday for at least some Windows systems. I m still getting the ^M at the end of each line. ... The same is true
      Message 2 of 11 , May 26, 2003
      • 0 Attachment
        On Mon 26-May-03 4:59pm-0400, Bram Moolenaar wrote:

        > Patch 6.2f.004
        > Problem: "vim --version" always uses CR/LF in the output.
        > Solution: Omit the CR.

        It doesn't fix the problem reported Sunday for at least some Windows
        systems. I'm still getting the '^M' at the end of each line.

        From my email Sunday:

        > I'm running 6.2f on XP Pro - not a 'nix. But I also get odd results.
        > My lines end with <CR><CR><LF> so I see a '^M' at the end of each
        > line.

        The same is true with 6.2f.6.

        --
        Best regards,
        Bill

        "John 3:16 For God so loved the world that he temporarily died to save it
        from himself. But none of that really matters because most people
        will be tortured for eternity anyways."
        [Matt Miller]
      • Mikolaj Machowski
        ... OK now :) m. -- LaTeX + Vim = http://vim-latex.sourceforge.net/ Vim-list(s) Users Map: (last change 27 May) http://skawina.eu.org/mikolaj/vimlist Are You
        Message 3 of 11 , May 27, 2003
        • 0 Attachment
          On Mon, May 26, 2003 at 10:59:28PM +0200, Bram Moolenaar wrote:
          > Patch 6.2f.004
          > Problem: "vim --version" always uses CR/LF in the output.
          > Solution: Omit the CR.
          > Files: src/message.c, src/os_unix.c

          OK now :)

          m.
          --
          LaTeX + Vim = http://vim-latex.sourceforge.net/
          Vim-list(s) Users Map: (last change 27 May)
          http://skawina.eu.org/mikolaj/vimlist
          Are You There?
        • Bram Moolenaar
          ... On MS-Windows you are supposed to get CR-LF at the end of each line. It works for me (compiled with MSVC or DJGPP). ... What did you compile Vim with?
          Message 4 of 11 , May 27, 2003
          • 0 Attachment
            Bill McCarthy wrote:

            > On Mon 26-May-03 4:59pm-0400, Bram Moolenaar wrote:
            >
            > > Patch 6.2f.004
            > > Problem: "vim --version" always uses CR/LF in the output.
            > > Solution: Omit the CR.
            >
            > It doesn't fix the problem reported Sunday for at least some Windows
            > systems. I'm still getting the '^M' at the end of each line.

            On MS-Windows you are supposed to get CR-LF at the end of each line. It
            works for me (compiled with MSVC or DJGPP).

            > >From my email Sunday:
            >
            > > I'm running 6.2f on XP Pro - not a 'nix. But I also get odd results.
            > > My lines end with <CR><CR><LF> so I see a '^M' at the end of each
            > > line.
            >
            > The same is true with 6.2f.6.

            What did you compile Vim with? When using MingW or Cygwin you might get
            different results.

            --
            Engineers will go without food and hygiene for days to solve a problem.
            (Other times just because they forgot.)
            (Scott Adams - The Dilbert principle)

            /// 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 ///
            \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
          • Bill McCarthy
            ... Well of course, but not CR-CR-LF - that s where the ^M at the end of each line comes from in vim --version. BTW, vim --help doesn t do it. ...
            Message 5 of 11 , May 27, 2003
            • 0 Attachment
              On Tue 27-May-03 5:28pm-0400, Bram Moolenaar wrote:
              > Bill McCarthy wrote:

              >> It doesn't fix the problem reported Sunday for at least some Windows
              >> systems. I'm still getting the '^M' at the end of each line.

              > On MS-Windows you are supposed to get CR-LF at the end of each line. It
              > works for me (compiled with MSVC or DJGPP).

              Well of course, but not CR-CR-LF - that's where the '^M' at the end of
              each line comes from in vim --version. BTW, vim --help doesn't do it.

              >>>From my email Sunday:
              >>>
              >>> I'm running 6.2f on XP Pro - not a 'nix. But I also get odd results.
              >>> My lines end with <CR><CR><LF> so I see a '^M' at the end of each
              >>> line.

              >> The same is true with 6.2f.6.

              > What did you compile Vim with? When using MingW or Cygwin you might get
              > different results.

              Make_ming.mak with the latest MinGW. This is not new. Since you
              fixed the problem for the Linux crowd, I was hoping it could be fixed
              for the rest of us. I'm not sure how it could be a `make` problem,
              unless some weird switch is being used. I've never encountered
              extraneous CR's with my own C programs - so I'm surprised to hear it
              may be a MinGW problem. It seem more likely that the problem is in
              Vim.

              --
              Best regards,
              Bill

              "It is said that a neurotic builds castles in the sky and the
              psychotic moves in. What does this say about the mental state
              of Christians with their Heaven paved in gold?"
              [Donald Morgan]
            • Bram Moolenaar
              ... Sounds like the same problem we previously had with the Unix version, except that you have an extra CR. ... There must be something in the MingW code that
              Message 6 of 11 , May 28, 2003
              • 0 Attachment
                Bill McCarthy wrote:

                > >> It doesn't fix the problem reported Sunday for at least some Windows
                > >> systems. I'm still getting the '^M' at the end of each line.
                >
                > > On MS-Windows you are supposed to get CR-LF at the end of each line. It
                > > works for me (compiled with MSVC or DJGPP).
                >
                > Well of course, but not CR-CR-LF - that's where the '^M' at the end of
                > each line comes from in vim --version. BTW, vim --help doesn't do it.

                Sounds like the same problem we previously had with the Unix version,
                except that you have an extra CR.

                > >>>From my email Sunday:
                > >>>
                > >>> I'm running 6.2f on XP Pro - not a 'nix. But I also get odd results.
                > >>> My lines end with <CR><CR><LF> so I see a '^M' at the end of each
                > >>> line.
                >
                > >> The same is true with 6.2f.6.
                >
                > > What did you compile Vim with? When using MingW or Cygwin you might get
                > > different results.
                >
                > Make_ming.mak with the latest MinGW. This is not new. Since you
                > fixed the problem for the Linux crowd, I was hoping it could be fixed
                > for the rest of us. I'm not sure how it could be a `make` problem,
                > unless some weird switch is being used. I've never encountered
                > extraneous CR's with my own C programs - so I'm surprised to hear it
                > may be a MinGW problem. It seem more likely that the problem is in
                > Vim.

                There must be something in the MingW code that adds the extra CR.
                That's probably from translating the LF to CF-LF. I don't have MingW
                thus I can't find out where this happens.

                --
                Every engineer dreams about saving the universe and having sex with aliens.
                This is much more glamorous than the real life of an engineer, which consists
                of hiding from the universe and having sex without the participation of other
                life forms.
                (Scott Adams - The Dilbert principle)

                /// 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 ///
                \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
              • Dan Sharp
                ... ... The patch appeared to work for me. I compiled using MinGW with the base 6.2f code, then C: TEMP vim62f src vim --help help.out
                Message 7 of 11 , May 28, 2003
                • 0 Attachment
                  Bram Moolenaar wrote:
                  > Bill McCarthy wrote:
                  >
                  >>>>It doesn't fix the problem reported Sunday for at least some Windows
                  >>>>systems. I'm still getting the '^M' at the end of each line.
                  >>
                  >>>On MS-Windows you are supposed to get CR-LF at the end of each line. It
                  >>>works for me (compiled with MSVC or DJGPP).
                  >>
                  >>Well of course, but not CR-CR-LF - that's where the '^M' at the end of
                  >>each line comes from in vim --version. BTW, vim --help doesn't do it.
                  >
                  > Sounds like the same problem we previously had with the Unix version,
                  > except that you have an extra CR.

                  <snip>

                  > There must be something in the MingW code that adds the extra CR.
                  > That's probably from translating the LF to CF-LF. I don't have MingW
                  > thus I can't find out where this happens.

                  The patch appeared to work for me. I compiled using MinGW with the base
                  6.2f code, then

                  C:\TEMP\vim62f\src> vim --help > help.out
                  C:\TEMP\vim62f\src> vim --version > version.out
                  C:\TEMP\vim62f\src> vim help.out version.out

                  The help.out looked correct, but version.out had the extra ^M characters
                  at the end. I applied patch 6.2f.004 and recompiled, did the same
                  three commands as above, and now version.out does not have the extra ^M
                  characters.

                  Dan Sharp
                • Bill McCarthy
                  ... Thanks Bram and Dan for responding. I was testing like Dan before patch 004. After the patch, I testing slightly differently: vim --help | gvim - shows
                  Message 8 of 11 , May 28, 2003
                  • 0 Attachment
                    On Wed 28-May-03 5:07am-0400, Bram Moolenaar wrote:

                    > There must be something in the MingW code that adds the extra
                    > CR. That's probably from translating the LF to CF-LF. I don't
                    > have MingW thus I can't find out where this happens.

                    On Wed 28-May-03 10:26am-0400, Dan Sharp wrote:

                    > The patch appeared to work for me. I compiled using MinGW with
                    > the base 6.2f code, then
                    >
                    > C:\TEMP\vim62f\src> vim --help > help.out
                    > C:\TEMP\vim62f\src> vim --version > version.out
                    > C:\TEMP\vim62f\src> vim help.out version.out
                    >
                    > The help.out looked correct, but version.out had the extra ^M
                    > characters at the end. I applied patch 6.2f.004 and
                    > recompiled, did the same three commands as above, and now
                    > version.out does not have the extra ^M characters.

                    Thanks Bram and Dan for responding. I was testing like Dan
                    before patch 004. After the patch, I testing slightly
                    differently:

                    vim --help | gvim -

                    shows no trailing '^M' in the output.

                    vim --version | gvim -

                    has the trailing '^M' on each line. This can also be seen by:

                    vim --version > version.out
                    gvim - < version.out

                    The file version.out does NOT have CR-CR-LF like the pre-004
                    produced. It has the standard CR-LF.

                    After playing around a bit, I saw the problem. The version.out
                    file ends without a final CR-LF sequence - it ends without any
                    EOL sequence.

                    The problem is in the fileformat detection. When a 'dos' file is
                    redirected to or piped to vim (or gvim) and the file does not
                    contain an EOL in the final line, vim/gvim interprets the file as
                    'unix' - thus we see the '^M' at the end of each line.

                    The solution, without modifying ff detection, is not to do this
                    :-) In vim, the --version should sent the last line of output
                    WITH an appropriate EOL.

                    I know Bram is trying to get 6.2 released, so the ff detection
                    problems can be addressed later - both the problem above and the
                    problem, I've reported before, with failure on long lines.

                    --
                    Best regards,
                    Bill

                    "Power tends to corrupt and absolute power corrupts absolutely.
                    That unalterable rule applies both to God and man."
                    [John Emerich Edward Dalberg-Acton (Lord Acton) in
                    a letter to Bishop Mandell Creighton, April 5,1887]
                  • Bram Moolenaar
                    ... That s what I see too. ... I don t see this. When editing the vim --version output I get fileformat correctly set to dos and noeol . ... Adding a
                    Message 9 of 11 , May 29, 2003
                    • 0 Attachment
                      Bill McCarthy wrote:

                      > Thanks Bram and Dan for responding. I was testing like Dan
                      > before patch 004. After the patch, I testing slightly
                      > differently:
                      >
                      > vim --help | gvim -
                      >
                      > shows no trailing '^M' in the output.
                      >
                      > vim --version | gvim -
                      >
                      > has the trailing '^M' on each line. This can also be seen by:
                      >
                      > vim --version > version.out
                      > gvim - < version.out
                      >
                      > The file version.out does NOT have CR-CR-LF like the pre-004
                      > produced. It has the standard CR-LF.
                      >
                      > After playing around a bit, I saw the problem. The version.out
                      > file ends without a final CR-LF sequence - it ends without any
                      > EOL sequence.

                      That's what I see too.

                      > The problem is in the fileformat detection. When a 'dos' file is
                      > redirected to or piped to vim (or gvim) and the file does not
                      > contain an EOL in the final line, vim/gvim interprets the file as
                      > 'unix' - thus we see the '^M' at the end of each line.

                      I don't see this. When editing the "vim --version" output I get
                      'fileformat' correctly set to "dos" and 'noeol'.

                      > The solution, without modifying ff detection, is not to do this
                      > :-) In vim, the --version should sent the last line of output
                      > WITH an appropriate EOL.
                      >
                      > I know Bram is trying to get 6.2 released, so the ff detection
                      > problems can be addressed later - both the problem above and the
                      > problem, I've reported before, with failure on long lines.

                      Adding a newline after the version output is the logical thing to do.
                      The list_version() function doesn't do it, so that ":version" doesn't
                      end in an empty line. It can be fixed in main(). Fixing it in
                      version.c is not the best solution.

                      --
                      Me? A skeptic? I trust you have proof.

                      /// 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 ///
                      \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
                    • Bill McCarthy
                      ... Yes, if you saved the output to, say, vv.txt. Then `vim vv.txt` shows the file correctly as DOS and [noeol]. However if you redirect, as I said above,
                      Message 10 of 11 , May 29, 2003
                      • 0 Attachment
                        On Thu 29-May-03 6:29am-0400, Bram Moolenaar wrote:
                        > Bill McCarthy wrote:

                        >> The problem is in the fileformat detection. When a 'dos' file is
                        >> redirected to or piped to vim (or gvim) and the file does not
                        >> contain an EOL in the final line, vim/gvim interprets the file as
                        >> 'unix' - thus we see the '^M' at the end of each line.

                        > I don't see this. When editing the "vim --version" output I get
                        > 'fileformat' correctly set to "dos" and 'noeol'.

                        Yes, if you saved the output to, say, vv.txt. Then `vim vv.txt` shows
                        the file correctly as DOS and [noeol]. However if you redirect, as I
                        said above, with `vim - < vv.txt`, you see the '^M's, no [noeol], but
                        [unix].

                        --
                        Best regards,
                        Bill

                        "Religion is what keeps the poor from murdering the rich."
                        [Napoleon Bonaparte]
                      • Bram Moolenaar
                        ... It seems that this was so unexpected that I didn t read it properly. But I can reproduce it. I ll make a fix for it. -- Making it up? Why should I want
                        Message 11 of 11 , May 29, 2003
                        • 0 Attachment
                          Bill McCarthy wrote:

                          > >> The problem is in the fileformat detection. When a 'dos' file is
                          > >> redirected to or piped to vim (or gvim) and the file does not
                          > >> contain an EOL in the final line, vim/gvim interprets the file as
                          > >> 'unix' - thus we see the '^M' at the end of each line.
                          >
                          > > I don't see this. When editing the "vim --version" output I get
                          > > 'fileformat' correctly set to "dos" and 'noeol'.
                          >
                          > Yes, if you saved the output to, say, vv.txt. Then `vim vv.txt` shows
                          > the file correctly as DOS and [noeol]. However if you redirect, as I
                          > said above, with `vim - < vv.txt`, you see the '^M's, no [noeol], but
                          > [unix].

                          It seems that this was so unexpected that I didn't read it properly.
                          But I can reproduce it. I'll make a fix for it.

                          --
                          "Making it up? Why should I want to make anything up? Life's bad enough
                          as it is without wanting to invent any more of it."
                          -- Marvin, the Paranoid Android in Douglas Adams'
                          "The Hitchhiker's Guide to the Galaxy"

                          /// 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 ///
                          \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
                        Your message has been successfully submitted and would be delivered to recipients shortly.