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.1262 < prev    next >
Encoding:
Internet Message Format  |  2013-06-28  |  5.5 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.1262
  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.1262
  11. Problem:    Crash and compilation warnings with Cygwin.
  12. Solution:   Check return value of XmbTextListToTextProperty(). Add type casts.
  13.         Adjust #ifdefs. (Lech Lorens)
  14. Files:        src/main.c, src/os_unix.c, src/ui.c
  15.  
  16.  
  17. *** ../vim-7.3.1261/src/main.c    2013-06-15 21:54:11.000000000 +0200
  18. --- src/main.c    2013-06-29 14:04:10.000000000 +0200
  19. ***************
  20. *** 2408,2414 ****
  21.            * Look for evidence of non-Cygwin paths before we bother.
  22.            * This is only for when using the Unix files.
  23.            */
  24. !         if (strpbrk(p, "\\:") != NULL && !path_with_url(p))
  25.           {
  26.           char posix_path[PATH_MAX];
  27.   
  28. --- 2408,2414 ----
  29.            * Look for evidence of non-Cygwin paths before we bother.
  30.            * This is only for when using the Unix files.
  31.            */
  32. !         if (vim_strpbrk(p, "\\:") != NULL && !path_with_url(p))
  33.           {
  34.           char posix_path[PATH_MAX];
  35.   
  36. ***************
  37. *** 2418,2424 ****
  38.           cygwin_conv_to_posix_path(p, posix_path);
  39.   # endif
  40.           vim_free(p);
  41. !         p = vim_strsave(posix_path);
  42.           if (p == NULL)
  43.               mch_exit(2);
  44.           }
  45. --- 2418,2424 ----
  46.           cygwin_conv_to_posix_path(p, posix_path);
  47.   # endif
  48.           vim_free(p);
  49. !         p = vim_strsave((char_u *)posix_path);
  50.           if (p == NULL)
  51.               mch_exit(2);
  52.           }
  53. *** ../vim-7.3.1261/src/os_unix.c    2013-04-15 15:32:20.000000000 +0200
  54. --- src/os_unix.c    2013-06-29 14:04:10.000000000 +0200
  55. ***************
  56. *** 1559,1565 ****
  57.   {
  58.       /* This function should not return, it causes exit().  Longjump instead. */
  59.       LONGJMP(lc_jump_env, 1);
  60. ! #  ifdef VMS
  61.       return 0;  /* avoid the compiler complains about missing return value */
  62.   #  endif
  63.   }
  64. --- 1559,1565 ----
  65.   {
  66.       /* This function should not return, it causes exit().  Longjump instead. */
  67.       LONGJMP(lc_jump_env, 1);
  68. ! #  if defined(VMS) || defined(__CYGWIN__) || defined(__CYGWIN32__)
  69.       return 0;  /* avoid the compiler complains about missing return value */
  70.   #  endif
  71.   }
  72. ***************
  73. *** 1581,1587 ****
  74.   
  75.       /* This function should not return, it causes exit().  Longjump instead. */
  76.       LONGJMP(x_jump_env, 1);
  77. ! # ifdef VMS
  78.       return 0;  /* avoid the compiler complains about missing return value */
  79.   # endif
  80.   }
  81. --- 1581,1587 ----
  82.   
  83.       /* This function should not return, it causes exit().  Longjump instead. */
  84.       LONGJMP(x_jump_env, 1);
  85. ! # if defined(VMS) || defined(__CYGWIN__) || defined(__CYGWIN32__)
  86.       return 0;  /* avoid the compiler complains about missing return value */
  87.   # endif
  88.   }
  89. ***************
  90. *** 5929,5935 ****
  91.   # if defined(__CYGWIN__) || defined(__CYGWIN32__)
  92.       /* Translate <CR><NL> into <NL>.  Caution, buffer may contain NUL. */
  93.       p = buffer;
  94. !     for (i = 0; i < len; ++i)
  95.       if (!(buffer[i] == CAR && buffer[i + 1] == NL))
  96.           *p++ = buffer[i];
  97.       len = p - buffer;
  98. --- 5929,5935 ----
  99.   # if defined(__CYGWIN__) || defined(__CYGWIN32__)
  100.       /* Translate <CR><NL> into <NL>.  Caution, buffer may contain NUL. */
  101.       p = buffer;
  102. !     for (i = 0; i < (int)len; ++i)
  103.       if (!(buffer[i] == CAR && buffer[i + 1] == NL))
  104.           *p++ = buffer[i];
  105.       len = p - buffer;
  106. *** ../vim-7.3.1261/src/ui.c    2013-04-12 12:27:24.000000000 +0200
  107. --- src/ui.c    2013-06-29 14:08:21.000000000 +0200
  108. ***************
  109. *** 2366,2379 ****
  110.       {
  111.       XTextProperty    text_prop;
  112.       char        *string_nt = (char *)alloc((unsigned)*length + 1);
  113.   
  114.       /* create NUL terminated string which XmbTextListToTextProperty wants */
  115.       mch_memmove(string_nt, string, (size_t)*length);
  116.       string_nt[*length] = NUL;
  117. !     XmbTextListToTextProperty(X_DISPLAY, (char **)&string_nt, 1,
  118. !                           XCompoundTextStyle, &text_prop);
  119.       vim_free(string_nt);
  120.       XtFree(*value);            /* replace with COMPOUND text */
  121.       *value = (XtPointer)(text_prop.value);    /*    from plain text */
  122.       *length = text_prop.nitems;
  123.       *type = compound_text_atom;
  124. --- 2366,2385 ----
  125.       {
  126.       XTextProperty    text_prop;
  127.       char        *string_nt = (char *)alloc((unsigned)*length + 1);
  128. +     int        conv_result;
  129.   
  130.       /* create NUL terminated string which XmbTextListToTextProperty wants */
  131.       mch_memmove(string_nt, string, (size_t)*length);
  132.       string_nt[*length] = NUL;
  133. !     conv_result = XmbTextListToTextProperty(X_DISPLAY, (char **)&string_nt,
  134. !                        1, XCompoundTextStyle, &text_prop);
  135.       vim_free(string_nt);
  136.       XtFree(*value);            /* replace with COMPOUND text */
  137. +     if (conv_result != Success)
  138. +     {
  139. +         vim_free(string);
  140. +         return False;
  141. +     }
  142.       *value = (XtPointer)(text_prop.value);    /*    from plain text */
  143.       *length = text_prop.nitems;
  144.       *type = compound_text_atom;
  145. *** ../vim-7.3.1261/src/version.c    2013-06-29 13:58:26.000000000 +0200
  146. --- src/version.c    2013-06-29 14:04:32.000000000 +0200
  147. ***************
  148. *** 730,731 ****
  149. --- 730,733 ----
  150.   {   /* Add new patch number below this line */
  151. + /**/
  152. +     1262,
  153.   /**/
  154.  
  155. -- 
  156. MORTICIAN:    Bring out your dead!
  157.               [clang]
  158.               Bring out your dead!
  159.               [clang]
  160.               Bring out your dead!
  161. CUSTOMER:     Here's one -- nine pence.
  162. DEAD PERSON:  I'm not dead!
  163.                                   The Quest for the Holy Grail (Monty Python)
  164.  
  165.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  166. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  167. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  168.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  169.