sync with OpenBSD -current

This commit is contained in:
purplerain 2024-07-12 14:44:09 +02:00
parent 2d1e52c274
commit b5b25afdb8
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
657 changed files with 21464 additions and 54675 deletions

View file

@ -270,6 +270,7 @@ STRICT_CFLAGS = @STRICT_CFLAGS@
STRIP = @STRIP@
STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@
TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@
USE_THREAD_LIBS = @USE_THREAD_LIBS@
VERSION = @VERSION@
WCHAR32 = @WCHAR32@
X11_CFLAGS = @X11_CFLAGS@

View file

@ -1,5 +1,5 @@
/*
* Copyright 1991, 1992 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1991, 1992, Oracle and/or its affiliates.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),

View file

@ -1,5 +1,5 @@
/*
* Copyright 1990, 1991, 1992 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1990, 1991, 1992, Oracle and/or its affiliates.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@ -980,34 +980,30 @@ _XimProtoIMFree(
Xim im)
{
/* XIMPrivateRec */
if (im->private.proto.im_onkeylist) {
Xfree(im->private.proto.im_onkeylist);
im->private.proto.im_onkeylist = NULL;
}
if (im->private.proto.im_offkeylist) {
Xfree(im->private.proto.im_offkeylist);
im->private.proto.im_offkeylist = NULL;
}
Xfree(im->private.proto.im_onkeylist);
im->private.proto.im_onkeylist = NULL;
Xfree(im->private.proto.im_offkeylist);
im->private.proto.im_offkeylist = NULL;
if (im->private.proto.intrproto) {
_XimFreeProtoIntrCallback(im);
im->private.proto.intrproto = NULL;
}
if (im->private.proto.im_inner_resources) {
Xfree(im->private.proto.im_inner_resources);
im->private.proto.im_inner_resources = NULL;
}
if (im->private.proto.ic_inner_resources) {
Xfree(im->private.proto.ic_inner_resources);
im->private.proto.ic_inner_resources = NULL;
}
if (im->private.proto.hold_data) {
Xfree(im->private.proto.hold_data);
im->private.proto.hold_data = NULL;
}
if (im->private.proto.locale_name) {
Xfree(im->private.proto.locale_name);
im->private.proto.locale_name = NULL;
_XimFreeProtoIntrCallback(im);
im->private.proto.intrproto = NULL;
}
Xfree(im->private.proto.im_inner_resources);
im->private.proto.im_inner_resources = NULL;
Xfree(im->private.proto.ic_inner_resources);
im->private.proto.ic_inner_resources = NULL;
Xfree(im->private.proto.hold_data);
im->private.proto.hold_data = NULL;
Xfree(im->private.proto.locale_name);
im->private.proto.locale_name = NULL;
if (im->private.proto.ctom_conv) {
_XlcCloseConverter(im->private.proto.ctom_conv);
im->private.proto.ctom_conv = NULL;
@ -1047,48 +1043,37 @@ _XimProtoIMFree(
}
#endif /* XIM_CONNECTABLE */
if (im->private.proto.saved_imvalues) {
Xfree(im->private.proto.saved_imvalues);
im->private.proto.saved_imvalues = NULL;
}
if (im->private.proto.default_styles) {
Xfree(im->private.proto.default_styles);
im->private.proto.default_styles = NULL;
}
Xfree(im->private.proto.saved_imvalues);
im->private.proto.saved_imvalues = NULL;
Xfree(im->private.proto.default_styles);
im->private.proto.default_styles = NULL;
/* core */
if (im->core.res_name) {
Xfree(im->core.res_name);
im->core.res_name = NULL;
}
if (im->core.res_class) {
Xfree(im->core.res_class);
im->core.res_class = NULL;
}
if (im->core.im_values_list) {
Xfree(im->core.im_values_list);
im->core.im_values_list = NULL;
}
if (im->core.ic_values_list) {
Xfree(im->core.ic_values_list);
im->core.ic_values_list = NULL;
}
if (im->core.im_name) {
Xfree(im->core.im_name);
im->core.im_name = NULL;
}
if (im->core.styles) {
Xfree(im->core.styles);
im->core.styles = NULL;
}
if (im->core.im_resources) {
Xfree(im->core.im_resources);
im->core.im_resources = NULL;
}
if (im->core.ic_resources) {
Xfree(im->core.ic_resources);
im->core.ic_resources = NULL;
}
Xfree(im->core.res_name);
im->core.res_name = NULL;
Xfree(im->core.res_class);
im->core.res_class = NULL;
Xfree(im->core.im_values_list);
im->core.im_values_list = NULL;
Xfree(im->core.ic_values_list);
im->core.ic_values_list = NULL;
Xfree(im->core.im_name);
im->core.im_name = NULL;
Xfree(im->core.styles);
im->core.styles = NULL;
Xfree(im->core.im_resources);
im->core.im_resources = NULL;
Xfree(im->core.ic_resources);
im->core.ic_resources = NULL;
return;
}

View file

@ -212,6 +212,9 @@ _XimRegisterIMInstantiateCallback(
if( xim ) {
lock = True;
xim->methods->close( (XIM)xim );
/* XIMs must be freed manually after being opened; close just
does the protocol to deinitialize the IM. */
XFree( xim );
lock = False;
icb->call = True;
callback( display, client_data, NULL );

View file

@ -61,10 +61,16 @@ _XimLocalDestroyIC(
if (ic->core.focus_window)
_XUnregisterFilter(ic->core.im->core.display,
ic->core.focus_window, _XimLocalFilter, (XPointer)ic);
if(ic->private.local.ic_resources) {
Xfree(ic->private.local.ic_resources);
ic->private.local.ic_resources = NULL;
}
Xfree(ic->private.local.ic_resources);
ic->private.local.ic_resources = NULL;
Xfree(ic->core.res_name);
ic->core.res_name=NULL;
Xfree(ic->core.res_class);
ic->core.res_class = NULL;
return;
}
@ -138,12 +144,13 @@ _XimLocalCreateIC(
XIMArg *values)
{
Xic ic;
XimDefICValues ic_values;
XimDefICValues ic_values={ 0 };
XIMResourceList res;
unsigned int num;
int len;
if((ic = Xcalloc(1, sizeof(XicRec))) == (Xic)NULL) {
ic = Xcalloc(1, sizeof(XicRec));
if( ic == (Xic)NULL) {
return ((XIC)NULL);
}
@ -158,15 +165,15 @@ _XimLocalCreateIC(
num = im->core.ic_num_resources;
len = sizeof(XIMResource) * num;
if((res = Xmalloc(len)) == (XIMResourceList)NULL) {
res = Xmalloc(len);
if( res == (XIMResourceList)NULL) {
goto Set_Error;
}
(void)memcpy((char *)res, (char *)im->core.ic_resources, len);
ic->private.local.ic_resources = res;
ic->private.local.ic_num_resources = num;
bzero((char *)&ic_values, sizeof(XimDefICValues));
if(_XimCheckLocalInputStyle(ic, (XPointer)&ic_values, values,
if(_XimCheckLocalInputStyle(ic, (XPointer)&ic_values, values,
im->core.styles, res, num) == False) {
goto Set_Error;
}
@ -190,10 +197,10 @@ _XimLocalCreateIC(
return((XIC)ic);
Set_Error :
if (ic->private.local.ic_resources) {
Xfree(ic->private.local.ic_resources);
ic->private.local.ic_resources = NULL;
}
Xfree(ic->private.local.ic_resources);
ic->private.local.ic_resources = NULL;
Xfree(ic);
return((XIC)NULL);
}

View file

@ -678,7 +678,7 @@ parseline(
b->treesize = newsize;
/* Re-derive top after realloc() to avoid undefined behaviour
(and crashes on architectures that track pointer bounds). */
if (top >= (DTIndex *) old && top < (DTIndex *) &old[oldsize])
if (old && top >= (DTIndex *) old && top < (DTIndex *) &old[oldsize])
top = (DTIndex *) (((char *)new) + (((char *)top)-(char *)old));
}
p = &b->tree[b->treeused];

View file

@ -510,13 +510,21 @@ _XimDefaultResName(
Xic ic = (Xic)parm;
Xim im = (Xim)ic->core.im;
char **out;
char *string;
if(im->core.res_name == (char *)NULL) {
return True;
}
string=strdup(im->core.res_name);
if ( string == NULL)
return False;
out = (char **)((char *)top + info->offset);
*out = im->core.res_name;
Xfree(*out); /* free old im->core.res_name */
*out =string;
return True;
}
@ -529,14 +537,22 @@ _XimDefaultResClass(
{
Xic ic = (Xic)parm;
Xim im = (Xim)ic->core.im;
char *string;
char **out;
if(im->core.res_class == (char *)NULL) {
return True;
}
string=strdup(im->core.res_class);
if (string == NULL)
return False;
out = (char **)((char *)top + info->offset);
*out = im->core.res_class;
Xfree(*out); /* free old im->core.res_class */
*out = string;
return True;
}
@ -820,9 +836,8 @@ _XimEncodeString(
}
out = (char **)((char *)top + info->offset);
if(*out) {
Xfree(*out);
}
Xfree(*out);
*out = string;
return True;
}
@ -1947,7 +1962,7 @@ static const XimICMode ic_mode[] = {
0,
0},
{OFFSET_XNSPOTLOCATION,
0, /*(XIM_MODE_PRE_SET | XIM_MODE_PRE_GET),*/
(XIM_MODE_PRE_SET | XIM_MODE_PRE_GET),
(XIM_MODE_PRE_CREATE | XIM_MODE_PRE_SET | XIM_MODE_PRE_GET),
0,
(XIM_MODE_PRE_SET | XIM_MODE_PRE_GET),

View file

@ -1,5 +1,5 @@
/*
* Copyright 1992 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1992, Oracle and/or its affiliates.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),

View file

@ -1,5 +1,5 @@
/*
* Copyright 1992 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1992, Oracle and/or its affiliates.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),

View file

@ -1,5 +1,5 @@
/*
* Copyright 1992 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1992, Oracle and/or its affiliates.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),