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

Patch 7.4b.012

Expand Messages
  • Bram Moolenaar
    Patch 7.4b.012 Problem: Output from a shell command is truncated at a NUL. (lcd 47) Solution: Change every NUL into an SOH. Files: src/misc1.c ...
    Message 1 of 7 , Aug 3, 2013
    • 0 Attachment
      Patch 7.4b.012
      Problem: Output from a shell command is truncated at a NUL. (lcd 47)
      Solution: Change every NUL into an SOH.
      Files: src/misc1.c
      *** ../vim-7.4b.011/src/misc1.c 2013-07-05 19:44:45.000000000 +0200
      --- src/misc1.c 2013-08-03 13:59:15.000000000 +0200
      ***************
      *** 10887,10893 ****
      --- 10887,10900 ----
      buffer = NULL;
      }
      else
      + {
      + /* Change NUL into SOH, otherwise the string is truncated. */
      + for (i = 0; i < len; ++i)
      + if (buffer[len] == NUL)
      + buffer[len] = 1;
      +
      buffer[len] = NUL; /* make sure the buffer is terminated */
      + }

      done:
      vim_free(tempname);
      *** ../vim-7.4b.011/src/version.c 2013-08-03 13:41:12.000000000 +0200
      --- src/version.c 2013-08-03 14:00:24.000000000 +0200
      ***************
      *** 729,730 ****
      --- 729,732 ----
      { /* Add new patch number below this line */
      + /**/
      + 12,
      /**/



      --
      It was recently discovered that research causes cancer in rats.

      /// 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.
    • Nazri Ramliy
      ... The loop above doesn t look right to. Shouldn t it be like this instead?: for (i = 0; i
      Message 2 of 7 , Aug 3, 2013
      • 0 Attachment
        On Sat, Aug 3, 2013 at 8:11 PM, Bram Moolenaar <Bram@...> wrote:
        > + /* Change NUL into SOH, otherwise the string is truncated. */
        > + for (i = 0; i < len; ++i)
        > + if (buffer[len] == NUL)
        > + buffer[len] = 1;

        The loop above doesn't look right to. Shouldn't it be like this instead?:

        for (i = 0; i < len; ++i)
        if (buffer[i] == NUL)
        buffer[i] = 1;

        nazri

        --
        --
        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.
      • LCD 47
        ... Yes, +1 for this. /lcd -- -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the text you are replying to.
        Message 3 of 7 , Aug 3, 2013
        • 0 Attachment
          On 3 August 2013, Nazri Ramliy <ayiehere@...> wrote:
          > On Sat, Aug 3, 2013 at 8:11 PM, Bram Moolenaar <Bram@...> wrote:
          > > + /* Change NUL into SOH, otherwise the string is truncated. */
          > > + for (i = 0; i < len; ++i)
          > > + if (buffer[len] == NUL)
          > > + buffer[len] = 1;
          >
          > The loop above doesn't look right to. Shouldn't it be like this instead?:
          >
          > for (i = 0; i < len; ++i)
          > if (buffer[i] == NUL)
          > buffer[i] = 1;

          Yes, +1 for this.

          /lcd

          --
          --
          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
          ... This code is so simple it doesn t need a test . I need more coffee... -- Light travels faster than sound. This is why some people appear bright until you
          Message 4 of 7 , Aug 3, 2013
          • 0 Attachment
            Nazri Ramliy wrote:

            > On Sat, Aug 3, 2013 at 8:11 PM, Bram Moolenaar <Bram@...> wrote:
            > > + /* Change NUL into SOH, otherwise the string is truncated. */
            > > + for (i = 0; i < len; ++i)
            > > + if (buffer[len] == NUL)
            > > + buffer[len] = 1;
            >
            > The loop above doesn't look right to. Shouldn't it be like this instead?:
            >
            > for (i = 0; i < len; ++i)
            > if (buffer[i] == NUL)
            > buffer[i] = 1;
            >

            "This code is so simple it doesn't need a test".

            I need more coffee...

            --
            Light travels faster than sound. This is why some people
            appear bright until you hear them speak

            /// 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.
          • Tony Mechelynck
            ... Why into an SOH, and not into a (non-line-breaking) LF like everywhere else in Vim? Best regards, Tony. -- I consider the day misspent that I am not either
            Message 5 of 7 , Aug 3, 2013
            • 0 Attachment
              On 03/08/13 14:11, Bram Moolenaar wrote:
              >
              > Patch 7.4b.012
              > Problem: Output from a shell command is truncated at a NUL. (lcd 47)
              > Solution: Change every NUL into an SOH.
              > Files: src/misc1.c

              Why into an SOH, and not into a (non-line-breaking) LF like everywhere
              else in Vim?


              Best regards,
              Tony.
              --
              I consider the day misspent that I am not either charged with a crime,
              or arrested for one.
              -- "Ratsy" Tourbillon


              --
              --
              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.
            • LCD 47
              ... Because then NUL would be indistinguishable from normal LF, which may or may not be what you want when parsing compiler errors. SOHs can be converted to
              Message 6 of 7 , Aug 3, 2013
              • 0 Attachment
                On 4 August 2013, Tony Mechelynck <antoine.mechelynck@...> wrote:
                > On 03/08/13 14:11, Bram Moolenaar wrote:
                > >
                > >Patch 7.4b.012
                > >Problem: Output from a shell command is truncated at a NUL. (lcd 47)
                > >Solution: Change every NUL into an SOH.
                > >Files: src/misc1.c
                >
                > Why into an SOH, and not into a (non-line-breaking) LF like
                > everywhere else in Vim?

                Because then NUL would be indistinguishable from "normal" LF, which
                may or may not be what you want when parsing compiler errors. SOHs
                can be converted to LFs if you don't need them, but not the other way
                around.

                /lcd

                --
                --
                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
                ... Because you then can t see the difference between a real LF (which occurs very often) and what used to be a NUL. For the same reason I didn t use a space.
                Message 7 of 7 , Aug 4, 2013
                • 0 Attachment
                  Tony Mechelynck wrote:

                  > On 03/08/13 14:11, Bram Moolenaar wrote:
                  > >
                  > > Patch 7.4b.012
                  > > Problem: Output from a shell command is truncated at a NUL. (lcd 47)
                  > > Solution: Change every NUL into an SOH.
                  > > Files: src/misc1.c
                  >
                  > Why into an SOH, and not into a (non-line-breaking) LF like everywhere
                  > else in Vim?

                  Because you then can't see the difference between a real LF (which
                  occurs very often) and what used to be a NUL.

                  For the same reason I didn't use a space.

                  Now you can't see the difference between what used to be a NUL and a
                  real SOH, but that just doesn't happen often.

                  --
                  hundred-and-one symptoms of being an internet addict:
                  44. Your friends no longer send you e-mail...they just log on to your IRC
                  channel.

                  /// 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.
                Your message has been successfully submitted and would be delivered to recipients shortly.