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

Patch 6.3a.026 (extra)

Expand Messages
  • Bram Moolenaar
    Patch 6.3a.026 (extra, after 6.3a.008) Problem: Editing files on Windows 98 doesn t work when encoding is utf-8 (Antoine Mechelynck) Warning for missing
    Message 1 of 8 , May 15, 2004
    • 0 Attachment
      Patch 6.3a.026 (extra, after 6.3a.008)
      Problem: Editing files on Windows 98 doesn't work when 'encoding' is
      "utf-8" (Antoine Mechelynck)
      Warning for missing function prototype.
      Solution: For all wide functions check if it failed because it is not
      implemented. Use ANSI function declaration for char_to_string().
      Files: src/gui_w48.c, src/os_mswin.c, src/os_win32.c


      *** ../vim-6.3a.025/src/gui_w48.c Thu May 13 14:36:40 2004
      --- src/gui_w48.c Sat May 15 15:11:28 2004
      ***************
      *** 480,489 ****
      * Return the length.
      */
      static int
      ! char_to_string(ch, string, slen)
      ! int ch;
      ! char_u *string;
      ! int slen;
      {
      int len;
      int i;
      --- 480,486 ----
      * Return the length.
      */
      static int
      ! char_to_string(int ch, char_u *string, int slen)
      {
      int len;
      int i;
      ***************
      *** 2711,2724 ****
      if (title != NULL && enc_codepage >= 0 && enc_codepage != (int)GetACP())
      {
      WCHAR *wbuf;

      /* Convert the title from 'encoding' to ucs2. */
      wbuf = (WCHAR *)enc_to_ucs2(title, NULL);
      if (wbuf != NULL)
      {
      ! SetWindowTextW(s_hwnd, wbuf);
      vim_free(wbuf);
      ! return;
      }
      }
      #endif
      --- 2708,2724 ----
      if (title != NULL && enc_codepage >= 0 && enc_codepage != (int)GetACP())
      {
      WCHAR *wbuf;
      + int n;

      /* Convert the title from 'encoding' to ucs2. */
      wbuf = (WCHAR *)enc_to_ucs2(title, NULL);
      if (wbuf != NULL)
      {
      ! n = SetWindowTextW(s_hwnd, wbuf);
      vim_free(wbuf);
      ! if (n != 0 || GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
      ! return;
      ! /* Retry with non-wide function (for Windows 98). */
      }
      }
      #endif
      ***************
      *** 3128,3139 ****
      for (i = 0; i < cFiles; ++i)
      {
      #ifdef FEAT_MBYTE
      ! DragQueryFileW(hDrop, i, szFile, BUFPATHLEN);
      ! fnames[i] = ucs2_to_enc(szFile, NULL);
      ! #else
      ! DragQueryFile(hDrop, i, szFile, BUFPATHLEN);
      ! fnames[i] = vim_strsave(szFile);
      #endif
      }

      DragFinish(hDrop);
      --- 3128,3141 ----
      for (i = 0; i < cFiles; ++i)
      {
      #ifdef FEAT_MBYTE
      ! if (DragQueryFileW(hDrop, i, szFile, BUFPATHLEN) > 0)
      ! fnames[i] = ucs2_to_enc(szFile, NULL);
      ! else
      #endif
      + {
      + DragQueryFile(hDrop, i, szFile, BUFPATHLEN);
      + fnames[i] = vim_strsave(szFile);
      + }
      }

      DragFinish(hDrop);
      *** ../vim-6.3a.025/src/os_mswin.c Fri May 7 10:59:38 2004
      --- src/os_mswin.c Sat May 15 15:17:39 2004
      ***************
      *** 460,466 ****
      {
      n = _wstat(wp, (struct _stat *)stp);
      vim_free(wp);
      ! return n;
      }
      }
      #endif
      --- 460,470 ----
      {
      n = _wstat(wp, (struct _stat *)stp);
      vim_free(wp);
      ! if (n >= 0)
      ! return n;
      ! /* Retry with non-wide function (for Windows 98). Can't use
      ! * GetLastError() here and it's unclear what errno gets set to if
      ! * the _wstat() fails for missing wide functions. */
      }
      }
      #endif
      *** ../vim-6.3a.025/src/os_win32.c Tue May 11 17:54:06 2004
      --- src/os_win32.c Sat May 15 15:17:49 2004
      ***************
      *** 4366,4372 ****
      vim_free(wn);
      wn = NULL;
      }
      ! (void)FindClose(hFile);
      }
      if (wn == NULL)
      #endif
      --- 4366,4373 ----
      vim_free(wn);
      wn = NULL;
      }
      ! else
      ! (void)FindClose(hFile);
      }
      if (wn == NULL)
      #endif
      ***************
      *** 4469,4475 ****
      {
      f = _wopen(wn, flags, mode);
      vim_free(wn);
      ! return f;
      }
      }

      --- 4470,4480 ----
      {
      f = _wopen(wn, flags, mode);
      vim_free(wn);
      ! if (f >= 0)
      ! return f;
      ! /* Retry with non-wide function (for Windows 98). Can't use
      ! * GetLastError() here and it's unclear what errno gets set to if
      ! * the _wopen() fails for missing wide functions. */
      }
      }

      ***************
      *** 4483,4501 ****
      mch_fopen(char *name, char *mode)
      {
      WCHAR *wn, *wm;
      ! FILE *f;

      if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
      {
      wn = enc_to_ucs2(name, NULL);
      wm = enc_to_ucs2(mode, NULL);
      if (wn != NULL && wm != NULL)
      - {
      f = _wfopen(wn, wm);
      - return f;
      - }
      vim_free(wn);
      vim_free(wm);
      }

      return fopen(name, mode);
      --- 4488,4508 ----
      mch_fopen(char *name, char *mode)
      {
      WCHAR *wn, *wm;
      ! FILE *f = NULL;

      if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
      {
      wn = enc_to_ucs2(name, NULL);
      wm = enc_to_ucs2(mode, NULL);
      if (wn != NULL && wm != NULL)
      f = _wfopen(wn, wm);
      vim_free(wn);
      vim_free(wm);
      + if (f != NULL)
      + return f;
      + /* Retry with non-wide function (for Windows 98). Can't use
      + * GetLastError() here and it's unclear what errno gets set to if
      + * the _wfopen() fails for missing wide functions. */
      }

      return fopen(name, mode);
      *** ../vim-6.3a.025/src/version.c Sat May 15 12:24:16 2004
      --- src/version.c Sat May 15 17:07:50 2004
      ***************
      *** 643,644 ****
      --- 643,646 ----
      { /* Add new patch number below this line */
      + /**/
      + 26,
      /**/

      --
      GUARD #1: Where'd you get the coconut?
      ARTHUR: We found them.
      GUARD #1: Found them? In Mercea? The coconut's tropical!
      ARTHUR: What do you mean?
      GUARD #1: Well, this is a temperate zone.
      The Quest for the Holy Grail (Monty Python)

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
      \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
    • Antoine J. Mechelynck
      ... [...] Ach... Je hebt het nog niet. Included patches: 1-26 ... d: index.htm [readonly][READ ERRORS] 0L, 0C Reading viminfo file D:/HOME/_viminfo marks ...
      Message 2 of 8 , May 15, 2004
      • 0 Attachment
        Bram Moolenaar <Bram@...> wrote:
        > Patch 6.3a.026 (extra, after 6.3a.008)
        > Problem: Editing files on Windows 98 doesn't work when 'encoding'
        > is "utf-8" (Antoine Mechelynck)
        [...]

        Ach... Je hebt het nog niet.

        Included patches: 1-26

        :set enc=utf8 tenc=latin1
        :setg bomb
        :view d:/index.htm
        d:\index.htm [readonly][READ ERRORS] 0L, 0C
        Reading viminfo file D:/HOME/_viminfo marks
        :help
        E149: Sorry, no help for help.txt
        :view $VI9MRUNTIME/doc/help.txt
        C:\Program Files\VIM\vim63a\doc\help.txt [readonly][READ ERRORS] 0L, 0C
        Reading viminfo file D:/HOME/_viminfo marks
        :set enc=latin1
        :help
        "help.txt" [readonly] --No lines in buffer--
        E434: Can't find tag pattern
        :view $VIMRUNTIME/doc/help.txt
        "help.txt" [readonly] 197L, 7453C
        (The help is displayed, it looks OK)

        Regards,
        Tony.
      • Bram Moolenaar
        ... Setting termencoding should not be needed. ... Very strange that this still happens. I verified again on my Windows 98 system, where it previously
        Message 3 of 8 , May 15, 2004
        • 0 Attachment
          Antoine J. Mechelynck wrote:

          > Bram Moolenaar <Bram@...> wrote:
          > > Patch 6.3a.026 (extra, after 6.3a.008)
          > > Problem: Editing files on Windows 98 doesn't work when 'encoding'
          > > is "utf-8" (Antoine Mechelynck)
          > [...]
          >
          > Ach... Je hebt het nog niet.
          >
          > Included patches: 1-26
          >
          > :set enc=utf8 tenc=latin1

          Setting 'termencoding' should not be needed.

          > :setg bomb
          > :view d:/index.htm
          > d:\index.htm [readonly][READ ERRORS] 0L, 0C

          Very strange that this still happens. I verified again on my Windows 98
          system, where it previously failed. With patch 26 included it works
          just fine. I only notice a warning that I'll make another patch for.

          Are you sure you have included all patches without problems?

          I'll upload a gvim.exe for you to try out:

          ftp://ftp.vim.org/pub/vim/unstable/tryout/gvim.exe

          It's 1239040 bytes. I'll delete as soon as you let me know you got it.

          --
          This is the polymorph virus! Follow these instructions carefully:
          1. Send this message to everybody you know.
          2. Format your harddisk.
          Thank you for your cooperation in spreading the most powerful virus ever!

          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
          /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
          \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
          \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
        • Antoine J. Mechelynck
          ... I thought I had. ... Thanks. I got it and it works. Now I gotta delete my build directory, download the sources again, and patch them, trying to make it
          Message 4 of 8 , May 15, 2004
          • 0 Attachment
            Bram Moolenaar <Bram@...> wrote:
            > Antoine J. Mechelynck wrote:
            >
            > > Bram Moolenaar <Bram@...> wrote:
            > > > Patch 6.3a.026 (extra, after 6.3a.008)
            > > > Problem: Editing files on Windows 98 doesn't work when
            > > > 'encoding' is "utf-8" (Antoine Mechelynck)
            > > [...]
            > >
            > > Ach... Je hebt het nog niet.
            > >
            > > Included patches: 1-26
            > >
            > > :set enc=utf8 tenc=latin1
            >
            > Setting 'termencoding' should not be needed.
            >
            > > :setg bomb
            > > :view d:/index.htm
            > > d:\index.htm [readonly][READ ERRORS] 0L, 0C
            >
            > Very strange that this still happens. I verified again on my Windows
            > 98 system, where it previously failed. With patch 26 included it
            > works
            > just fine. I only notice a warning that I'll make another patch for.
            >
            > Are you sure you have included all patches without problems?

            I thought I had.
            >
            > I'll upload a gvim.exe for you to try out:
            >
            > ftp://ftp.vim.org/pub/vim/unstable/tryout/gvim.exe
            >
            > It's 1239040 bytes. I'll delete as soon as you let me know you got
            > it.

            Thanks. I got it and it works. Now I gotta delete my build directory,
            download the sources again, and patch them, trying to make it work, so
            hopefully someday I'll learn how to do it.

            BTW: When make creates a file from a here-document I get the "Replace (Y/N)
            ?" prompt. Could it be possible to use "copy /Y" instead of just "copy"?
            That should allow command.com to overwrite without prompting.

            In my latest build (now superseded by yours) I saw "suspicious pointer
            conversion" twice in gui_w48 (lines 3136, 3137). Maybe that's what you're
            making a new patch for?

            Best regards,
            Tony.
          • Bram Moolenaar
            ... Very good. I think it s time to send out 6.3b then. ... I did some work on a bare Windows 98 system yesterday, and it was really tough to work without all
            Message 5 of 8 , May 16, 2004
            • 0 Attachment
              Antoine J. Mechelynck wrote:

              > > I'll upload a gvim.exe for you to try out:
              > >
              > > ftp://ftp.vim.org/pub/vim/unstable/tryout/gvim.exe
              > >
              > > It's 1239040 bytes. I'll delete as soon as you let me know you got
              > > it.
              >
              > Thanks. I got it and it works.

              Very good. I think it's time to send out 6.3b then.

              > Now I gotta delete my build directory, download the sources again, and
              > patch them, trying to make it work, so hopefully someday I'll learn
              > how to do it.

              I did some work on a bare Windows 98 system yesterday, and it was really
              tough to work without all those (Unix) tools that I got used to. No
              command completion or history make it really hard!

              > BTW: When make creates a file from a here-document I get the "Replace (Y/N)
              > ?" prompt. Could it be possible to use "copy /Y" instead of just "copy"?
              > That should allow command.com to overwrite without prompting.

              That sounds like a good idea. I assume "copy /y" works on all systems.

              > In my latest build (now superseded by yours) I saw "suspicious pointer
              > conversion" twice in gui_w48 (lines 3136, 3137). Maybe that's what you're
              > making a new patch for?

              I fixed that with patch 6.3a.027.

              --
              DEAD PERSON: I'm getting better!
              CUSTOMER: No, you're not -- you'll be stone dead in a moment.
              MORTICIAN: Oh, I can't take him like that -- it's against regulations.
              The Quest for the Holy Grail (Monty Python)

              /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
              /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
              \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
              \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
            • Antoine J. Mechelynck
              Bram Moolenaar wrote: [...] ... [...] You told me some time ago that you have 4DOS.COM. It is of course more Dos-like than Unix-like but
              Message 6 of 8 , May 17, 2004
              • 0 Attachment
                Bram Moolenaar <Bram@...> wrote:
                [...]
                > I did some work on a bare Windows 98 system yesterday, and it was
                > really tough to work without all those (Unix) tools that I got used
                > to. No
                > command completion or history make it really hard!
                [...]

                You told me some time ago that you have 4DOS.COM. It is of course more
                Dos-like than Unix-like but IIUC it has, amog others, command-line history
                completion, filename/dirname completion, and (I think) STDERR redirection
                and a "help" which doesn't compare with Unix "man" or "info" but is better
                than the nothing there used to be in Dos 3 :-). But it might or might not
                know about LFN :-( (thus beware of DEL or MOVE if DIR doesn't show them).

                And even in the oldest of COMMAND.COM I ever knew, you can recall the latest
                command-line (from cursor to EOL) with F3; edit it by toggling
                Insert/Replace mode through <Ins>, etc. (There are other "editing keys", but
                I forgot about them through lack of use). In the COMMAND.COM that comes with
                W98 you can step through the latest command-line character-wise with <Left>
                and <Right>. But I agree with you that it's a poor excuse for what I call
                "history".

                Best regards,
                Tony.
              • Bram Moolenaar
                ... On another Windows 98 system I used 4DOS. For XP you need 4NT.com, but the XP console is usable without it, since history and completion work. ... I
                Message 7 of 8 , May 17, 2004
                • 0 Attachment
                  Antoine J. Mechelynck wrote:

                  > Bram Moolenaar <Bram@...> wrote:
                  > [...]
                  > > I did some work on a bare Windows 98 system yesterday, and it was
                  > > really tough to work without all those (Unix) tools that I got used
                  > > to. No
                  > > command completion or history make it really hard!
                  > [...]
                  >
                  > You told me some time ago that you have 4DOS.COM.

                  On another Windows 98 system I used 4DOS. For XP you need 4NT.com, but
                  the XP console is usable without it, since history and completion work.

                  > And even in the oldest of COMMAND.COM I ever knew, you can recall the latest
                  > command-line (from cursor to EOL) with F3; edit it by toggling
                  > Insert/Replace mode through <Ins>, etc. (There are other "editing keys", but
                  > I forgot about them through lack of use). In the COMMAND.COM that comes with
                  > W98 you can step through the latest command-line character-wise with <Left>
                  > and <Right>. But I agree with you that it's a poor excuse for what I call
                  > "history".

                  I didn't know <F3> worked. Using 4DOS has the disadvantage that I never
                  looked into what options command.com offers.

                  --
                  I'm sure that I asked CBuilder to do a "full" install. Looks like I got
                  a "fool" install, instead. Charles E Campbell, Jr, PhD


                  /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                  /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                  \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
                  \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
                • Dan Sharp
                  ... If you load doskey.exe (available from DOS 6 on up) in your autoexec.bat ... UP and DOWN ARROWS recall commands; ESC clears command line; F7 displays
                  Message 8 of 8 , Jun 1, 2004
                  • 0 Attachment
                    Antoine J. Mechelynck wrote:
                    > Bram Moolenaar <Bram@...> wrote:
                    > [...]
                    >
                    >>I did some work on a bare Windows 98 system yesterday, and it was
                    >>really tough to work without all those (Unix) tools that I got used
                    >>to. No
                    >>command completion or history make it really hard!
                    >
                    > [...]
                    >
                    > You told me some time ago that you have 4DOS.COM. It is of course more
                    > Dos-like than Unix-like but IIUC it has, amog others, command-line history
                    > completion, filename/dirname completion, and (I think) STDERR redirection
                    > and a "help" which doesn't compare with Unix "man" or "info" but is better
                    > than the nothing there used to be in Dos 3 :-). But it might or might not
                    > know about LFN :-( (thus beware of DEL or MOVE if DIR doesn't show them).
                    >
                    > And even in the oldest of COMMAND.COM I ever knew, you can recall the latest
                    > command-line (from cursor to EOL) with F3; edit it by toggling
                    > Insert/Replace mode through <Ins>, etc. (There are other "editing keys", but
                    > I forgot about them through lack of use). In the COMMAND.COM that comes with
                    > W98 you can step through the latest command-line character-wise with <Left>
                    > and <Right>. But I agree with you that it's a poor excuse for what I call
                    > "history".

                    If you load doskey.exe (available from DOS 6 on up) in your autoexec.bat
                    file, you can get more command history editing capabilities. The help says:

                    ---
                    UP and DOWN ARROWS recall commands; ESC clears command line; F7 displays
                    command history; ALT+F7 clears command history; F8 searches command
                    history; F9 selects a command by number; ALT+F10 clears macro definitions.
                    ---

                    You can also define macros, which are like aliases under bash, and
                    several other things. Once I found it, I couldn't stand using a Dos /
                    Windows machine without doskey loaded.

                    The WinXP console has the above features built in.

                    Dan Sharp
                  Your message has been successfully submitted and would be delivered to recipients shortly.