]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.1262 v7.3.1262
authorBram Moolenaar <Bram@vim.org>
Sat, 29 Jun 2013 12:17:02 +0000 (14:17 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 29 Jun 2013 12:17:02 +0000 (14:17 +0200)
Problem:    Crash and compilation warnings with Cygwin.
Solution:   Check return value of XmbTextListToTextProperty(). Add type casts.
            Adjust #ifdefs. (Lech Lorens)

src/main.c
src/os_unix.c
src/ui.c
src/version.c

index 5c1405ea3c1764c067276683c2cbe549f3e2d619..884a3082ba621d161632facbd5fe69f67f014c75 100644 (file)
@@ -2408,7 +2408,7 @@ scripterror:
             * Look for evidence of non-Cygwin paths before we bother.
             * This is only for when using the Unix files.
             */
-           if (strpbrk(p, "\\:") != NULL && !path_with_url(p))
+           if (vim_strpbrk(p, "\\:") != NULL && !path_with_url(p))
            {
                char posix_path[PATH_MAX];
 
@@ -2418,7 +2418,7 @@ scripterror:
                cygwin_conv_to_posix_path(p, posix_path);
 # endif
                vim_free(p);
-               p = vim_strsave(posix_path);
+               p = vim_strsave((char_u *)posix_path);
                if (p == NULL)
                    mch_exit(2);
            }
index f878fa9578d474e72d470d8b8ebd1b39f574912e..8a7ae10b0475175665e848dcf18f122b2cf1f43f 100644 (file)
@@ -1559,7 +1559,7 @@ x_IOerror_check(dpy)
 {
     /* This function should not return, it causes exit().  Longjump instead. */
     LONGJMP(lc_jump_env, 1);
-#  ifdef VMS
+#  if defined(VMS) || defined(__CYGWIN__) || defined(__CYGWIN32__)
     return 0;  /* avoid the compiler complains about missing return value */
 #  endif
 }
@@ -1581,7 +1581,7 @@ x_IOerror_handler(dpy)
 
     /* This function should not return, it causes exit().  Longjump instead. */
     LONGJMP(x_jump_env, 1);
-# ifdef VMS
+# if defined(VMS) || defined(__CYGWIN__) || defined(__CYGWIN32__)
     return 0;  /* avoid the compiler complains about missing return value */
 # endif
 }
@@ -5929,7 +5929,7 @@ mch_expand_wildcards(num_pat, pat, num_file, file, flags)
 # if defined(__CYGWIN__) || defined(__CYGWIN32__)
     /* Translate <CR><NL> into <NL>.  Caution, buffer may contain NUL. */
     p = buffer;
-    for (i = 0; i < len; ++i)
+    for (i = 0; i < (int)len; ++i)
        if (!(buffer[i] == CAR && buffer[i + 1] == NL))
            *p++ = buffer[i];
     len = p - buffer;
index 49bc56b931f4f62fd13c99afb725e30a94fb627e..714d1938b8fc9815d354b4194d138daf1cda0cfb 100644 (file)
--- a/src/ui.c
+++ b/src/ui.c
@@ -2366,14 +2366,20 @@ clip_x11_convert_selection_cb(w, sel_atom, target, type, value, length, format)
     {
        XTextProperty   text_prop;
        char            *string_nt = (char *)alloc((unsigned)*length + 1);
+       int             conv_result;
 
        /* create NUL terminated string which XmbTextListToTextProperty wants */
        mch_memmove(string_nt, string, (size_t)*length);
        string_nt[*length] = NUL;
-       XmbTextListToTextProperty(X_DISPLAY, (char **)&string_nt, 1,
-                                             XCompoundTextStyle, &text_prop);
+       conv_result = XmbTextListToTextProperty(X_DISPLAY, (char **)&string_nt,
+                                          1, XCompoundTextStyle, &text_prop);
        vim_free(string_nt);
        XtFree(*value);                 /* replace with COMPOUND text */
+       if (conv_result != Success)
+       {
+           vim_free(string);
+           return False;
+       }
        *value = (XtPointer)(text_prop.value);  /*    from plain text */
        *length = text_prop.nitems;
        *type = compound_text_atom;
index 7fbb0eef6f63beb9d4016852aac62edd8cf63273..59fa0febb7c8f3b260f057e646adf348222eb97d 100644 (file)
@@ -728,6 +728,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1262,
 /**/
     1261,
 /**/