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

Re: Japanese titlestring patch

Expand Messages
  • Bram Moolenaar
    ... The manual page is a bit unclear on this point, but it certainly looks like the text_prop.value needs to be freed afterwards. -- BLACK KNIGHT: None shall
    Message 1 of 9 , Apr 14, 2003
    • 0 Attachment
      Motonobu Ichimura wrote:

      > I think when we use XmbTextListToTextProperty, text_prop.value is
      > newly allocated, so it needs to be XFree'd after using it.

      The manual page is a bit unclear on this point, but it certainly looks
      like the text_prop.value needs to be freed afterwards.

      --
      BLACK KNIGHT: None shall pass.
      ARTHUR: I have no quarrel with you, brave Sir knight, but I must cross
      this bridge.
      BLACK KNIGHT: Then you shall die.
      "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

      /// 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 ///
    • Kentaro Nakazawa
      The check of memory release and a return value was added and corrected. Index: os_unix.c ===================================================================
      Message 2 of 9 , Apr 14, 2003
      • 0 Attachment
        The check of memory release and a return value was added and corrected.



        Index: os_unix.c
        ===================================================================
        RCS file: /cvsroot/vim/vim/src/os_unix.c,v
        retrieving revision 1.77
        diff -c -r1.77 os_unix.c
        *** os_unix.c 31 Mar 2003 23:59:27 -0000 1.77
        --- os_unix.c 14 Apr 2003 11:50:43 -0000
        ***************
        *** 1549,1559 ****
        --- 1549,1579 ----
        #if XtSpecificationRelease >= 4
        XTextProperty text_prop;

        + # ifdef FEAT_XFONTSET
        + Status status;
        +
        + status = XmbTextListToTextProperty(x11_display,
        + (char **)&title, 1, XCompoundTextStyle, &text_prop);
        + if (status >= Success)
        + {
        + XSetWMName(x11_display, x11_window, &text_prop);
        + XFree(text_prop.value);
        + }
        + else
        + {
        + text_prop.value = title;
        + text_prop.nitems = STRLEN(title);
        + text_prop.encoding = XA_STRING;
        + text_prop.format = 8;
        + XSetWMName(x11_display, x11_window, &text_prop);
        + }
        + # else
        text_prop.value = title;
        text_prop.nitems = STRLEN(title);
        text_prop.encoding = XA_STRING;
        text_prop.format = 8;
        XSetWMName(x11_display, x11_window, &text_prop);
        + # endif
        #else
        XStoreName(x11_display, x11_window, (char *)title);
        #endif
        ***************
        *** 1572,1582 ****
        --- 1592,1622 ----
        #if XtSpecificationRelease >= 4
        XTextProperty text_prop;

        + # ifdef FEAT_XFONTSET
        + Status status;
        +
        + status = XmbTextListToTextProperty(x11_display,
        + (char **)&icon, 1, XCompoundTextStyle, &text_prop);
        + if (status >= Success)
        + {
        + XSetWMIconName(x11_display, x11_window, &text_prop);
        + XFree(text_prop.value);
        + }
        + else
        + {
        + text_prop.value = icon;
        + text_prop.nitems = STRLEN(icon);
        + text_prop.encoding = XA_STRING;
        + text_prop.format = 8;
        + XSetWMIconName(x11_display, x11_window, &text_prop);
        + }
        + # else
        text_prop.value = icon;
        text_prop.nitems = STRLEN(icon);
        text_prop.encoding = XA_STRING;
        text_prop.format = 8;
        XSetWMIconName(x11_display, x11_window, &text_prop);
        + # endif
        #else
        XSetIconName(x11_display, x11_window, (char *)icon);
        #endif



        ---
        Kentaro Nakazawa <kentaro@...>
      • Bram Moolenaar
        ... Thanks for updating the patch. -- Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald Knuth /// Bram Moolenaar --
        Message 3 of 9 , Apr 14, 2003
        • 0 Attachment
          Kentaro Nakazawa wrote:

          > The check of memory release and a return value was added and corrected.

          Thanks for updating the patch.

          --
          "Beware of bugs in the above code; I have only proved
          it correct, not tried it." -- Donald Knuth

          /// 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.