home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.3 / 7.3.852 < prev    next >
Encoding:
Internet Message Format  |  2013-03-06  |  3.3 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.852
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.3.852
  11. Problem:    system() breaks clipboard text. (Yukihiro Nakadaira)
  12. Solution:   Use Xutf8TextPropertyToTextList(). (Christian Brabandt)
  13.         Also do not put the text in the clip buffer if conversion fails.
  14. Files:        src/ui.c, src/ops.c
  15.  
  16.  
  17. *** ../vim-7.3.851/src/ui.c    2012-10-21 00:58:34.000000000 +0200
  18. --- src/ui.c    2013-03-07 17:30:37.000000000 +0100
  19. ***************
  20. *** 2119,2125 ****
  21.       text_prop.encoding = *type;
  22.       text_prop.format = *format;
  23.       text_prop.nitems = len;
  24. !     status = XmbTextPropertyToTextList(X_DISPLAY, &text_prop,
  25.                                &text_list, &n_text);
  26.       if (status != Success || n_text < 1)
  27.       {
  28. --- 2119,2131 ----
  29.       text_prop.encoding = *type;
  30.       text_prop.format = *format;
  31.       text_prop.nitems = len;
  32. ! #ifdef FEAT_MBYTE
  33. !     if (*type == utf8_atom)
  34. !         status = Xutf8TextPropertyToTextList(X_DISPLAY, &text_prop,
  35. !                              &text_list, &n_text);
  36. !     else
  37. ! #endif
  38. !         status = XmbTextPropertyToTextList(X_DISPLAY, &text_prop,
  39.                                &text_list, &n_text);
  40.       if (status != Success || n_text < 1)
  41.       {
  42. *** ../vim-7.3.851/src/ops.c    2012-12-12 16:11:28.000000000 +0100
  43. --- src/ops.c    2013-03-07 17:55:59.000000000 +0100
  44. ***************
  45. *** 5828,5833 ****
  46. --- 5828,5835 ----
  47.                              && len < 1024*1024 && len > 0)
  48.       {
  49.   #ifdef FEAT_MBYTE
  50. +     int ok = TRUE;
  51.       /* The CUT_BUFFER0 is supposed to always contain latin1.  Convert from
  52.        * 'enc' when it is a multi-byte encoding.  When 'enc' is an 8-bit
  53.        * encoding conversion usually doesn't work, so keep the text as-is.
  54. ***************
  55. *** 5842,5847 ****
  56. --- 5844,5850 ----
  57.           int    intlen = len;
  58.           char_u    *conv_str;
  59.   
  60. +         vc.vc_fail = TRUE;
  61.           conv_str = string_convert(&vc, str, &intlen);
  62.           len = intlen;
  63.           if (conv_str != NULL)
  64. ***************
  65. *** 5849,5860 ****
  66.               vim_free(str);
  67.               str = conv_str;
  68.           }
  69.           convert_setup(&vc, NULL, NULL);
  70.           }
  71.       }
  72.   #endif
  73. !     XStoreBuffer(dpy, (char *)str, (int)len, 0);
  74. !     XFlush(dpy);
  75.       }
  76.   
  77.       vim_free(str);
  78. --- 5852,5877 ----
  79.               vim_free(str);
  80.               str = conv_str;
  81.           }
  82. +         else
  83. +         {
  84. +             ok = FALSE;
  85. +         }
  86.           convert_setup(&vc, NULL, NULL);
  87.           }
  88. +         else
  89. +         {
  90. +         ok = FALSE;
  91. +         }
  92.       }
  93. +     /* Do not store the string if conversion failed.  Better to use any
  94. +      * other selection than garbled text. */
  95. +     if (ok)
  96.   #endif
  97. !     {
  98. !         XStoreBuffer(dpy, (char *)str, (int)len, 0);
  99. !         XFlush(dpy);
  100. !     }
  101.       }
  102.   
  103.       vim_free(str);
  104. *** ../vim-7.3.851/src/version.c    2013-03-07 16:41:26.000000000 +0100
  105. --- src/version.c    2013-03-07 18:01:08.000000000 +0100
  106. ***************
  107. *** 730,731 ****
  108. --- 730,733 ----
  109.   {   /* Add new patch number below this line */
  110. + /**/
  111. +     852,
  112.   /**/
  113.  
  114. -- 
  115. Tips for aliens in New York: Land anywhere.  Central Park, anywhere.
  116. No one will care or indeed even notice.
  117.         -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
  118.  
  119.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  120. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  121. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  122.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  123.