Problem: Crash and compilation warnings with Cygwin.
Solution: Check return value of XmbTextListToTextProperty(). Add type casts.
Adjust #ifdefs. (Lech Lorens)
* 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];
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);
}
{
/* 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
}
/* 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
}
# 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;
{
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;
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1262,
/**/
1261,
/**/