- Remove obsolete PreReq and Prefix stuff from specfile
- Fix BuildRoot to match the guidelines - Require base package by full EVR from devel package - Drop non relevant Patches and Sources - Rebase the still relevant patches - Actually apply the still relevant patches - Add a patch from Debian fixing an infinite loop (rh436998) - Add patches from Debian fixes various potential bufferoverflows
This commit is contained in:
parent
62b55b61de
commit
da66afb47d
@ -1,3 +1 @@
|
||||
Xaw3d-1.3.tar.gz
|
||||
Xaw3d-1.5.tar.gz
|
||||
Xaw3d-1.5E.tar.gz
|
||||
|
||||
232
Imakefile
232
Imakefile
@ -1,232 +0,0 @@
|
||||
XCOMM $XConsortium: Imakefile,v 1.78 91/09/18 14:28:23 rws Exp $
|
||||
#undef ForceNormalLib
|
||||
#define ForceNormalLib YES
|
||||
#define DoNormalLib NormalLibXaw6
|
||||
#define DoSharedLib SharedLibXaw6
|
||||
#define DoExtraLib SharedLibXaw6
|
||||
#define DoDebugLib DebugLibXaw6
|
||||
#define DoProfileLib ProfileLibXaw6
|
||||
#define HasSharedData YES
|
||||
#define LibName Xaw3d
|
||||
#define SoRev SOXAW6REV
|
||||
#define LibHeaders NO
|
||||
#define NoSoSymlink
|
||||
|
||||
#ifdef SharedXaw6Reqs
|
||||
REQUIREDLIBS = SharedXaw6Reqs
|
||||
#endif
|
||||
|
||||
DEFINES = XawI18nDefines -DOLDXAW
|
||||
EXTRA_INCLUDES = -I.
|
||||
|
||||
|
||||
LINTLIBS = $(LINTXLIB) $(LINTXTOOL)
|
||||
|
||||
# EXTRA_DEFINES = -DARROW_SCROLLBAR -DUSEGRAY
|
||||
|
||||
# EXTRA_INCLUDES = -I.
|
||||
|
||||
HEADERS = \
|
||||
AllWidgets.h \
|
||||
AsciiSink.h \
|
||||
AsciiSinkP.h \
|
||||
AsciiSrc.h \
|
||||
AsciiSrcP.h \
|
||||
AsciiText.h \
|
||||
AsciiTextP.h \
|
||||
Box.h \
|
||||
BoxP.h \
|
||||
Cardinals.h \
|
||||
Command.h \
|
||||
CommandP.h \
|
||||
Dialog.h \
|
||||
DialogP.h \
|
||||
Form.h \
|
||||
FormP.h \
|
||||
Grip.h \
|
||||
GripP.h \
|
||||
Label.h \
|
||||
LabelP.h \
|
||||
Layout.h \
|
||||
LayoutP.h \
|
||||
List.h \
|
||||
ListP.h \
|
||||
MenuButton.h \
|
||||
MenuButtoP.h \
|
||||
MultiSrc.h \
|
||||
MultiSrcP.h \
|
||||
MultiSink.h \
|
||||
MultiSinkP.h \
|
||||
Paned.h \
|
||||
PanedP.h \
|
||||
Panner.h \
|
||||
PannerP.h \
|
||||
Porthole.h \
|
||||
PortholeP.h \
|
||||
Repeater.h \
|
||||
RepeaterP.h \
|
||||
Reports.h \
|
||||
Scrollbar.h \
|
||||
ScrollbarP.h \
|
||||
Simple.h \
|
||||
SimpleP.h \
|
||||
SimpleMenu.h \
|
||||
SimpleMenP.h \
|
||||
Sme.h \
|
||||
SmeP.h \
|
||||
SmeBSB.h \
|
||||
SmeBSBP.h \
|
||||
SmeLine.h \
|
||||
SmeLineP.h \
|
||||
SmeThreeD.h \
|
||||
SmeThreeDP.h \
|
||||
StripChart.h \
|
||||
StripCharP.h \
|
||||
Template.c \
|
||||
Template.h \
|
||||
TemplateP.h \
|
||||
Text.h \
|
||||
TextP.h \
|
||||
TextSink.h \
|
||||
TextSinkP.h \
|
||||
TextSrc.h \
|
||||
TextSrcP.h \
|
||||
ThreeD.h \
|
||||
ThreeDP.h \
|
||||
Toggle.h \
|
||||
ToggleP.h \
|
||||
Tree.h \
|
||||
TreeP.h \
|
||||
VendorEP.h \
|
||||
Viewport.h \
|
||||
ViewportP.h \
|
||||
XawImP.h \
|
||||
XawInit.h
|
||||
|
||||
SRCS = \
|
||||
AllWidgets.c \
|
||||
AsciiSink.c \
|
||||
AsciiSrc.c \
|
||||
AsciiText.c \
|
||||
Box.c \
|
||||
Command.c \
|
||||
Dialog.c \
|
||||
Form.c \
|
||||
Grip.c \
|
||||
Label.c \
|
||||
Layout.c \
|
||||
List.c \
|
||||
MenuButton.c \
|
||||
MultiSrc.c \
|
||||
MultiSink.c \
|
||||
Paned.c \
|
||||
Panner.c \
|
||||
Porthole.c \
|
||||
Repeater.c \
|
||||
Scrollbar.c \
|
||||
Simple.c \
|
||||
SimpleMenu.c \
|
||||
Sme.c \
|
||||
SmeBSB.c \
|
||||
SmeLine.c \
|
||||
SmeThreeD.c \
|
||||
StripChart.c \
|
||||
Text.c \
|
||||
TextSink.c \
|
||||
TextSrc.c \
|
||||
TextAction.c \
|
||||
TextPop.c \
|
||||
TextTr.c \
|
||||
ThreeD.c \
|
||||
Toggle.c \
|
||||
Tree.c \
|
||||
Vendor.c \
|
||||
Viewport.c \
|
||||
XawIm.c \
|
||||
XawInit.c \
|
||||
XawI18n.c \
|
||||
sharedlib.c \
|
||||
laygram.c \
|
||||
laylex.c
|
||||
|
||||
#if SharedDataSeparation
|
||||
UNSHAREDOBJS = AllWidgets.o sharedlib.o
|
||||
#endif
|
||||
|
||||
OBJS = \
|
||||
AllWidgets.o \
|
||||
AsciiSink.o \
|
||||
AsciiSrc.o \
|
||||
AsciiText.o \
|
||||
Box.o \
|
||||
Command.o \
|
||||
Dialog.o \
|
||||
Form.o \
|
||||
Grip.o \
|
||||
Label.o \
|
||||
Layout.o \
|
||||
List.o \
|
||||
MenuButton.o \
|
||||
MultiSrc.o \
|
||||
MultiSink.o \
|
||||
Paned.o \
|
||||
Panner.o \
|
||||
Porthole.o \
|
||||
Repeater.o \
|
||||
Scrollbar.o \
|
||||
Simple.o \
|
||||
SimpleMenu.o \
|
||||
Sme.o \
|
||||
SmeBSB.o \
|
||||
SmeLine.o \
|
||||
SmeThreeD.o \
|
||||
StripChart.o \
|
||||
Text.o \
|
||||
TextSink.o \
|
||||
TextSrc.o \
|
||||
TextAction.o \
|
||||
TextPop.o \
|
||||
TextTr.o \
|
||||
ThreeD.o \
|
||||
Toggle.o \
|
||||
Tree.o \
|
||||
Vendor.o \
|
||||
Viewport.o \
|
||||
XawIm.o \
|
||||
XawI18n.o \
|
||||
XawInit.o \
|
||||
laygram.o \
|
||||
laylex.o
|
||||
|
||||
#include <Library.tmpl>
|
||||
|
||||
#ifdef LexCmd
|
||||
LEX=LexCmd
|
||||
#endif
|
||||
#ifdef YaccCmd
|
||||
YACC=YaccCmd
|
||||
#endif
|
||||
|
||||
all::
|
||||
|
||||
depend:: laygram.c laylex.c
|
||||
|
||||
#if DoSharedLib && SharedDataSeparation
|
||||
SpecialCObjectRule(sharedlib.o,NullParameter,$(SHLIBDEF))
|
||||
#endif
|
||||
|
||||
laygram.c : laygram.y
|
||||
$(YACC) -d laygram.y
|
||||
sed 's/yy/LayYY/g' y.tab.c > laygram.c
|
||||
sed 's/yy/LayYY/g' y.tab.h > laygram.h
|
||||
$(RM) y.tab.c y.tab.h
|
||||
|
||||
laylex.c: laylex.l
|
||||
$(LEX) laylex.l
|
||||
sed 's/yy/LayYY/g' lex.yy.c > laylex.c
|
||||
$(RM) lex.yy.c
|
||||
|
||||
clean::
|
||||
$(RM) laygram.c laylex.c
|
||||
|
||||
DependTarget()
|
||||
@ -1,970 +0,0 @@
|
||||
--- xaw3d-1.3.orig/lib/Xaw3d/AsciiSrc.c
|
||||
+++ xaw3d-1.3/lib/Xaw3d/AsciiSrc.c
|
||||
@@ -27,6 +27,8 @@
|
||||
|
||||
*/
|
||||
|
||||
+/* $XFree86: xc/lib/Xaw/AsciiSrc.c,v 1.1.1.2.4.2 1998/05/16 09:05:19 dawes Exp $ */
|
||||
+
|
||||
/*
|
||||
* AsciiSrc.c - AsciiSrc object. (For use with the text widget).
|
||||
*
|
||||
@@ -1293,15 +1295,21 @@
|
||||
XtQEfile = XrmPermStringToQuark(XtEfile);
|
||||
}
|
||||
|
||||
+ if (strlen((char *) fromVal->addr) >= sizeof(lowerName)) {
|
||||
+ XtStringConversionWarning((char *) fromVal->addr, XtRAsciiType);
|
||||
+ return;
|
||||
+ }
|
||||
XmuCopyISOLatin1Lowered(lowerName, (char *) fromVal->addr);
|
||||
q = XrmStringToQuark(lowerName);
|
||||
|
||||
if (q == XtQEstring) type = XawAsciiString;
|
||||
if (q == XtQEfile) type = XawAsciiFile;
|
||||
-
|
||||
- (*toVal).size = sizeof(XawAsciiType);
|
||||
- (*toVal).addr = (XPointer) &type;
|
||||
- return;
|
||||
+ if (q == XtQEstring || q == XtQEfile) {
|
||||
+ (*toVal).size = sizeof(XawAsciiType);
|
||||
+ (*toVal).addr = (XPointer) &type;
|
||||
+ return;
|
||||
+ }
|
||||
+ XtStringConversionWarning((char *) fromVal->addr, XtRAsciiType);
|
||||
}
|
||||
|
||||
#if (defined(ASCII_STRING) || defined(ASCII_DISK))
|
||||
--- xaw3d-1.3.orig/lib/Xaw3d/AsciiSrcP.h
|
||||
+++ xaw3d-1.3/lib/Xaw3d/AsciiSrcP.h
|
||||
@@ -50,6 +50,7 @@
|
||||
SOFTWARE.
|
||||
|
||||
******************************************************************/
|
||||
+/* $XFree86: xc/lib/Xaw/AsciiSrcP.h,v 1.1.1.1.12.1 1998/05/19 07:31:43 dawes Exp $ */
|
||||
|
||||
/*
|
||||
* AsciiSrcP.h - Private Header for Ascii Text Source.
|
||||
@@ -85,7 +86,11 @@
|
||||
#ifdef L_tmpnam
|
||||
#define TMPSIZ L_tmpnam
|
||||
#else
|
||||
-#define TMPSIZ 32 /* bytes to allocate for tmpnam */
|
||||
+#ifdef PATH_MAX
|
||||
+#define TMPSIZ PATH_MAX
|
||||
+#else
|
||||
+#define TMPSIZ 1024 /* bytes to allocate for tmpnam */
|
||||
+#endif
|
||||
#endif
|
||||
|
||||
#define MAGIC_VALUE ((XawTextPosition) -1) /* Magic value. */
|
||||
--- xaw3d-1.3.orig/lib/Xaw3d/Form.c
|
||||
+++ xaw3d-1.3/lib/Xaw3d/Form.c
|
||||
@@ -48,6 +48,8 @@
|
||||
|
||||
******************************************************************/
|
||||
|
||||
+/* $XFree86: xc/lib/Xaw/Form.c,v 1.1.1.1.12.2 1998/05/16 09:05:19 dawes Exp $ */
|
||||
+
|
||||
#include <X11/IntrinsicP.h>
|
||||
#include <X11/StringDefs.h>
|
||||
#include <X11/Xmu/Converters.h>
|
||||
@@ -185,6 +187,10 @@
|
||||
XrmQuark q;
|
||||
char lowerName[1000];
|
||||
|
||||
+ if (strlen((char*)fromVal->addr) >= sizeof(lowerName)) {
|
||||
+ XtStringConversionWarning(fromVal->addr, "edgeType");
|
||||
+ return;
|
||||
+ }
|
||||
XmuCopyISOLatin1Lowered (lowerName, (char*)fromVal->addr);
|
||||
q = XrmStringToQuark(lowerName);
|
||||
if (q == XtQChainLeft) {
|
||||
--- xaw3d-1.3.orig/lib/Xaw3d/MenuButton.c
|
||||
+++ xaw3d-1.3/lib/Xaw3d/MenuButton.c
|
||||
@@ -26,6 +26,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
+/* $XFree86: xc/lib/Xaw/MenuButton.c,v 3.0.6.2 1998/05/20 05:06:17 dawes Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
@@ -53,6 +54,8 @@
|
||||
#include <X11/Xaw3d/XawInit.h>
|
||||
#include <X11/Xaw3d/MenuButtoP.h>
|
||||
|
||||
+#include "XawAlloc.h"
|
||||
+
|
||||
static void ClassInitialize();
|
||||
static void PopupMenu();
|
||||
|
||||
@@ -179,9 +182,16 @@
|
||||
|
||||
if (menu == NULL) {
|
||||
char error_buf[BUFSIZ];
|
||||
- (void) sprintf(error_buf, "MenuButton: %s %s.",
|
||||
- "Could not find menu widget named", mbw->menu_button.menu_name);
|
||||
- XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
|
||||
+ char *err1 = "MenuButton: Could not find menu widget named ";
|
||||
+ char *perr;
|
||||
+ int len;
|
||||
+
|
||||
+ len = strlen(err1) + strlen(mbw->menu_button.menu_name) + 1 + 1;
|
||||
+ perr = XtStackAlloc(len, error_buf);
|
||||
+ if (perr == NULL) return;
|
||||
+ sprintf(perr, "%s%s.", err1, mbw->menu_button.menu_name);
|
||||
+ XtAppWarning(XtWidgetToApplicationContext(w), perr);
|
||||
+ XtStackFree(perr, error_buf);
|
||||
return;
|
||||
}
|
||||
if (!XtIsRealized(menu))
|
||||
--- xaw3d-1.3.orig/lib/Xaw3d/MultiSrc.c
|
||||
+++ xaw3d-1.3/lib/Xaw3d/MultiSrc.c
|
||||
@@ -1440,13 +1440,19 @@
|
||||
XtQEfile = XrmPermStringToQuark(XtEfile);
|
||||
}
|
||||
|
||||
+ if (strlen((char *) fromVal->addr) >= sizeof(lowerName)) {
|
||||
+ XtStringConversionWarning((char *) fromVal->addr, XtRAsciiType);
|
||||
+ return;
|
||||
+ }
|
||||
XmuCopyISOLatin1Lowered(lowerName, (char *) fromVal->addr);
|
||||
q = XrmStringToQuark(lowerName);
|
||||
|
||||
if (q == XtQEstring) type = XawAsciiString;
|
||||
if (q == XtQEfile) type = XawAsciiFile;
|
||||
-
|
||||
- (*toVal).size = sizeof(XawAsciiType);
|
||||
- (*toVal).addr = (XPointer) &type;
|
||||
- return;
|
||||
+ if (q == XtQEstring || q == XtQEfile) {
|
||||
+ (*toVal).size = sizeof(XawAsciiType);
|
||||
+ (*toVal).addr = (XPointer) &type;
|
||||
+ return;
|
||||
+ }
|
||||
+ XtStringConversionWarning((char *) fromVal->addr, XtRAsciiType);
|
||||
}
|
||||
--- xaw3d-1.3.orig/lib/Xaw3d/MultiSrcP.h
|
||||
+++ xaw3d-1.3/lib/Xaw3d/MultiSrcP.h
|
||||
@@ -72,6 +72,7 @@
|
||||
SOFTWARE.
|
||||
|
||||
******************************************************************/
|
||||
+/* $XFree86: xc/lib/Xaw/MultiSrcP.h,v 1.1.1.1.12.2 1998/05/19 14:36:47 dawes Exp $ */
|
||||
|
||||
/*
|
||||
* MultiSrcP.h - Private Header for Multi Text Source.
|
||||
@@ -113,7 +114,11 @@
|
||||
#ifdef L_tmpnam
|
||||
#define TMPSIZ L_tmpnam
|
||||
#else
|
||||
-#define TMPSIZ 32 /* bytes to allocate for tmpnam */
|
||||
+#ifdef PATH_MAX
|
||||
+#define TMPSIZ PATH_MAX
|
||||
+#else
|
||||
+#define TMPSIZ 1024 /* bytes to allocate for tmpnam */
|
||||
+#endif
|
||||
#endif
|
||||
|
||||
#define MAGIC_VALUE ((XawTextPosition) -1) /* Magic value. */
|
||||
--- xaw3d-1.3.orig/lib/Xaw3d/Simple.c
|
||||
+++ xaw3d-1.3/lib/Xaw3d/Simple.c
|
||||
@@ -48,6 +48,8 @@
|
||||
|
||||
******************************************************************/
|
||||
|
||||
+/* $XFree86: xc/lib/Xaw/Simple.c,v 1.1.1.1.12.2 1998/05/18 14:08:41 dawes Exp $ */
|
||||
+
|
||||
#include <stdio.h>
|
||||
#include <X11/IntrinsicP.h>
|
||||
#include <X11/StringDefs.h>
|
||||
@@ -55,6 +57,8 @@
|
||||
#include <X11/Xaw3d/SimpleP.h>
|
||||
#include <X11/Xmu/Drawing.h>
|
||||
|
||||
+#include "XawAlloc.h"
|
||||
+
|
||||
#define offset(field) XtOffsetOf(SimpleRec, simple.field)
|
||||
|
||||
static XtResource resources[] = {
|
||||
@@ -145,11 +149,17 @@
|
||||
|
||||
if (c->simple_class.change_sensitive == NULL) {
|
||||
char buf[BUFSIZ];
|
||||
-
|
||||
- (void) sprintf(buf,
|
||||
- "%s Widget: The Simple Widget class method 'change_sensitive' is undefined.\nA function must be defined or inherited.",
|
||||
- c->core_class.class_name);
|
||||
- XtWarning(buf);
|
||||
+ char *pbuf;
|
||||
+ char *msg1 = " Widget: The Simple Widget class method 'change_sensitive' is undefined.\nA function must be defined or inherited.";
|
||||
+ int len;
|
||||
+
|
||||
+ len = strlen(msg1) + strlen(c->core_class.class_name) + 1;
|
||||
+ pbuf = XtStackAlloc(len, buf);
|
||||
+ if (pbuf != NULL) {
|
||||
+ sprintf(pbuf, "%s%s", c->core_class.class_name, msg1);
|
||||
+ XtWarning(pbuf);
|
||||
+ XtStackFree(pbuf, buf);
|
||||
+ }
|
||||
c->simple_class.change_sensitive = ChangeSensitive;
|
||||
}
|
||||
|
||||
--- xaw3d-1.3.orig/lib/Xaw3d/SimpleMenu.c
|
||||
+++ xaw3d-1.3/lib/Xaw3d/SimpleMenu.c
|
||||
@@ -25,6 +25,8 @@
|
||||
in this Software without prior written authorization from the X Consortium.
|
||||
*/
|
||||
|
||||
+/* $XFree86: xc/lib/Xaw/SimpleMenu.c,v 3.1.6.3 1998/05/20 05:06:17 dawes Exp $ */
|
||||
+
|
||||
/*
|
||||
* SimpleMenu.c - Source code file for SimpleMenu widget.
|
||||
*
|
||||
@@ -47,6 +49,8 @@
|
||||
#include <X11/Xmu/Initer.h>
|
||||
#include <X11/Xmu/CharSet.h>
|
||||
|
||||
+#include "XawAlloc.h"
|
||||
+
|
||||
#define streq(a, b) ( strcmp((a), (b)) == 0 )
|
||||
|
||||
#define offset(field) XtOffsetOf(SimpleMenuRec, simple_menu.field)
|
||||
@@ -625,9 +629,17 @@
|
||||
|
||||
if ( (menu = FindMenu(w, params[0])) == NULL) {
|
||||
char error_buf[BUFSIZ];
|
||||
- (void) sprintf(error_buf, "%s '%s'",
|
||||
- "Xaw - SimpleMenuWidget: could not find menu named: ", params[0]);
|
||||
- XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
|
||||
+ char *err1 = "Xaw - SimpleMenuWidget: could not find menu named: ";
|
||||
+ char *perr;
|
||||
+ int len;
|
||||
+
|
||||
+ len = strlen(err1) + strlen(params[0]) + 2 + 1;
|
||||
+ perr = XtStackAlloc(len, error_buf);
|
||||
+ if (perr == NULL)
|
||||
+ return;
|
||||
+ sprintf(perr, "%s'%s'", err1, params[0]);
|
||||
+ XtAppWarning(XtWidgetToApplicationContext(w), perr);
|
||||
+ XtStackFree(perr, error_buf);
|
||||
return;
|
||||
}
|
||||
|
||||
--- xaw3d-1.3.orig/lib/Xaw3d/SmeBSB.c
|
||||
+++ xaw3d-1.3/lib/Xaw3d/SmeBSB.c
|
||||
@@ -25,6 +25,8 @@
|
||||
in this Software without prior written authorization from the X Consortium.
|
||||
*/
|
||||
|
||||
+/* $XFree86: xc/lib/Xaw/SmeBSB.c,v 1.1.1.2.2.3 1998/05/20 05:06:18 dawes Exp $ */
|
||||
+
|
||||
/*
|
||||
* SmeBSB.c - Source code file for BSB Menu Entry object.
|
||||
*
|
||||
@@ -55,6 +57,8 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
+#include "XawAlloc.h"
|
||||
+
|
||||
#define ONE_HUNDRED 100
|
||||
|
||||
#define offset(field) XtOffsetOf(SmeBSBRec, sme_bsb.field)
|
||||
@@ -601,22 +605,31 @@
|
||||
int x, y;
|
||||
unsigned int width, height;
|
||||
char buf[BUFSIZ];
|
||||
+ char *pbuf;
|
||||
+ int len;
|
||||
|
||||
if (is_left) {
|
||||
if (entry->sme_bsb.left_bitmap != None) {
|
||||
if (!XGetGeometry(XtDisplayOfObject(w),
|
||||
entry->sme_bsb.left_bitmap, &root,
|
||||
&x, &y, &width, &height, &bw, &depth)) {
|
||||
- (void) sprintf(buf, "Xaw SmeBSB Object: %s %s \"%s\".", "Could not",
|
||||
- "get Left Bitmap geometry information for menu entry ",
|
||||
- XtName(w));
|
||||
- XtAppError(XtWidgetToApplicationContext(w), buf);
|
||||
+ char *err1 = "Xaw SmeBSB Object: Could not get Left Bitmap geometry information for menu entry ";
|
||||
+ len = strlen(err1) + strlen(XtName(w)) + 3 + 1;
|
||||
+ pbuf = XtStackAlloc(len, buf);
|
||||
+ if (pbuf == NULL) return;
|
||||
+ sprintf(pbuf, "%s\"%s\".", err1, XtName(w));
|
||||
+ XtAppError(XtWidgetToApplicationContext(w), pbuf);
|
||||
+ XtStackFree(pbuf, buf);
|
||||
}
|
||||
if (depth != 1) {
|
||||
- (void) sprintf(buf, "Xaw SmeBSB Object: %s \"%s\"%s.",
|
||||
- "Left Bitmap of entry ",
|
||||
- XtName(w), " is not one bit deep.");
|
||||
- XtAppError(XtWidgetToApplicationContext(w), buf);
|
||||
+ char *err1 = "Xaw SmeBSB Object: Left Bitmap of entry ";
|
||||
+ char *err2 = " is not one bit deep.";
|
||||
+ len = strlen(err1) + strlen(err2) + strlen(XtName(w)) + 2 + 1;
|
||||
+ pbuf = XtStackAlloc(len, buf);
|
||||
+ if (pbuf == NULL) return;
|
||||
+ sprintf(pbuf, "%s\"%s\"%s", err1, XtName(w), err2);
|
||||
+ XtAppError(XtWidgetToApplicationContext(w), pbuf);
|
||||
+ XtStackFree(pbuf, buf);
|
||||
}
|
||||
entry->sme_bsb.left_bitmap_width = (Dimension) width;
|
||||
entry->sme_bsb.left_bitmap_height = (Dimension) height;
|
||||
@@ -626,16 +639,23 @@
|
||||
if (!XGetGeometry(XtDisplayOfObject(w),
|
||||
entry->sme_bsb.right_bitmap, &root,
|
||||
&x, &y, &width, &height, &bw, &depth)) {
|
||||
- (void) sprintf(buf, "Xaw SmeBSB Object: %s %s \"%s\".", "Could not",
|
||||
- "get Right Bitmap geometry information for menu entry ",
|
||||
- XtName(w));
|
||||
- XtAppError(XtWidgetToApplicationContext(w), buf);
|
||||
+ char *err1 = "Xaw SmeBSB Object: Could not get Right Bitmap geometry information for menu entry ";
|
||||
+ len = strlen(err1) + strlen(XtName(w)) + 3 + 1;
|
||||
+ pbuf = XtStackAlloc(len, buf);
|
||||
+ if (pbuf == NULL) return;
|
||||
+ sprintf(pbuf, "%s\"%s\".", err1, XtName(w));
|
||||
+ XtAppError(XtWidgetToApplicationContext(w), pbuf);
|
||||
+ XtStackFree(pbuf, buf);
|
||||
}
|
||||
if (depth != 1) {
|
||||
- (void) sprintf(buf, "Xaw SmeBSB Object: %s \"%s\"%s.",
|
||||
- "Right Bitmap of entry ", XtName(w),
|
||||
- " is not one bit deep.");
|
||||
- XtAppError(XtWidgetToApplicationContext(w), buf);
|
||||
+ char *err1 = "Xaw SmeBSB Object: Right Bitmap of entry ";
|
||||
+ char *err2 = " is not one bit deep.";
|
||||
+ len = strlen(err1) + strlen(err2) + strlen(XtName(w)) + 2 + 1;
|
||||
+ pbuf = XtStackAlloc(len, buf);
|
||||
+ if (pbuf == NULL) return;
|
||||
+ sprintf(pbuf, "%s\"%s\"%s", err1, XtName(w), err2);
|
||||
+ XtAppError(XtWidgetToApplicationContext(w), pbuf);
|
||||
+ XtStackFree(pbuf, buf);
|
||||
}
|
||||
entry->sme_bsb.right_bitmap_width = (Dimension) width;
|
||||
entry->sme_bsb.right_bitmap_height = (Dimension) height;
|
||||
--- xaw3d-1.3.orig/lib/Xaw3d/Text.c
|
||||
+++ xaw3d-1.3/lib/Xaw3d/Text.c
|
||||
@@ -48,6 +48,8 @@
|
||||
|
||||
******************************************************************/
|
||||
|
||||
+/* $XFree86: xc/lib/Xaw/Text.c,v 3.2.4.2 1998/05/16 09:05:21 dawes Exp $ */
|
||||
+
|
||||
#include <X11/IntrinsicP.h>
|
||||
#include <X11/StringDefs.h>
|
||||
#include <X11/Shell.h>
|
||||
@@ -72,6 +74,8 @@
|
||||
#include <X11/Xfuncs.h>
|
||||
#include <ctype.h> /* for isprint() */
|
||||
|
||||
+#include "XawAlloc.h"
|
||||
+
|
||||
#ifndef MAX_LEN_CT
|
||||
#define MAX_LEN_CT 6 /* for sequence: ESC $ ( A \xx \xx */
|
||||
#endif
|
||||
@@ -203,6 +207,10 @@
|
||||
inited = TRUE;
|
||||
}
|
||||
|
||||
+ if (strlen((char *)fromVal->addr) >= sizeof(lowerName)) {
|
||||
+ XtStringConversionWarning((char *) fromVal->addr, XtRScrollMode);
|
||||
+ return;
|
||||
+ }
|
||||
XmuCopyISOLatin1Lowered (lowerName, (char *)fromVal->addr);
|
||||
q = XrmStringToQuark(lowerName);
|
||||
|
||||
@@ -210,7 +218,7 @@
|
||||
else if (q == QScrollWhenNeeded) scrollMode = XawtextScrollWhenNeeded;
|
||||
else if (q == QScrollAlways) scrollMode = XawtextScrollAlways;
|
||||
else {
|
||||
- done(NULL, 0);
|
||||
+ XtStringConversionWarning((char *) fromVal->addr, XtRScrollMode);
|
||||
return;
|
||||
}
|
||||
done(&scrollMode, XawTextScrollMode);
|
||||
@@ -238,6 +246,10 @@
|
||||
inited = TRUE;
|
||||
}
|
||||
|
||||
+ if (strlen((char *)fromVal->addr) >= sizeof(lowerName)) {
|
||||
+ XtStringConversionWarning((char *) fromVal->addr, XtRWrapMode);
|
||||
+ return;
|
||||
+ }
|
||||
XmuCopyISOLatin1Lowered (lowerName, (char *)fromVal->addr);
|
||||
q = XrmStringToQuark(lowerName);
|
||||
|
||||
@@ -245,7 +257,7 @@
|
||||
else if (q == QWrapLine) wrapMode = XawtextWrapLine;
|
||||
else if (q == QWrapWord) wrapMode = XawtextWrapWord;
|
||||
else {
|
||||
- done(NULL, 0);
|
||||
+ XtStringConversionWarning((char *) fromVal->addr, XtRWrapMode);
|
||||
return;
|
||||
}
|
||||
done(&wrapMode, XawTextWrapMode);
|
||||
@@ -274,6 +286,10 @@
|
||||
inited = TRUE;
|
||||
}
|
||||
|
||||
+ if (strlen((char *)fromVal->addr) >= sizeof(lowerName)) {
|
||||
+ XtStringConversionWarning((char *) fromVal->addr, XtRResizeMode);
|
||||
+ return;
|
||||
+ }
|
||||
XmuCopyISOLatin1Lowered (lowerName, (char *)fromVal->addr);
|
||||
q = XrmStringToQuark(lowerName);
|
||||
|
||||
@@ -282,7 +298,7 @@
|
||||
else if (q == QResizeHeight) resizeMode = XawtextResizeHeight;
|
||||
else if (q == QResizeBoth) resizeMode = XawtextResizeBoth;
|
||||
else {
|
||||
- done(NULL, 0);
|
||||
+ XtStringConversionWarning((char *) fromVal->addr, XtRResizeMode);
|
||||
return;
|
||||
}
|
||||
done(&resizeMode, XawTextResizeMode);
|
||||
@@ -487,6 +503,8 @@
|
||||
{
|
||||
TextWidget ctx = (TextWidget) new;
|
||||
char error_buf[BUFSIZ];
|
||||
+ char *perr;
|
||||
+ int len;
|
||||
|
||||
ctx->text.lt.lines = 0;
|
||||
ctx->text.lt.info = NULL;
|
||||
@@ -523,10 +541,17 @@
|
||||
if (ctx->text.scroll_vert != XawtextScrollNever)
|
||||
if ( (ctx->text.resize == XawtextResizeHeight) ||
|
||||
(ctx->text.resize == XawtextResizeBoth) ) {
|
||||
- (void) sprintf(error_buf, "Xaw Text Widget %s:\n %s %s.", ctx->core.name,
|
||||
- "Vertical scrolling not allowed with height resize.\n",
|
||||
- "Vertical scrolling has been DEACTIVATED.");
|
||||
- XtAppWarning(XtWidgetToApplicationContext(new), error_buf);
|
||||
+ char *err1 = "Xaw Text Widget ";
|
||||
+ char *err2 = ":\nVertical scrolling not allowed with height resize.\n";
|
||||
+ char *err3 = "Vertical scrolling has been DEACTIVATED.";
|
||||
+ len = strlen(err1) + strlen(err2) + strlen(err3) +
|
||||
+ strlen(ctx->core.name) + 1;
|
||||
+ perr = XtStackAlloc(len, error_buf);
|
||||
+ if (perr != NULL) {
|
||||
+ (void) sprintf(perr, "%s%s%s%s", err1, ctx->core.name, err2, err3);
|
||||
+ XtAppWarning(XtWidgetToApplicationContext(new), perr);
|
||||
+ XtStackFree(perr, error_buf);
|
||||
+ }
|
||||
ctx->text.scroll_vert = XawtextScrollNever;
|
||||
}
|
||||
else if (ctx->text.scroll_vert == XawtextScrollAlways)
|
||||
@@ -534,18 +559,32 @@
|
||||
|
||||
if (ctx->text.scroll_horiz != XawtextScrollNever)
|
||||
if (ctx->text.wrap != XawtextWrapNever) {
|
||||
- (void) sprintf(error_buf, "Xaw Text Widget %s:\n %s %s.", ctx->core.name,
|
||||
- "Horizontal scrolling not allowed with wrapping active.\n",
|
||||
- "Horizontal scrolling has been DEACTIVATED.");
|
||||
- XtAppWarning(XtWidgetToApplicationContext(new), error_buf);
|
||||
+ char *err1 = "Xaw Text Widget ";
|
||||
+ char *err2 = ":\nHorizontal scrolling not allowed with wrapping active.";
|
||||
+ char *err3 = "\nHorizontal scrolling has been DEACTIVATED.";
|
||||
+ len = strlen(err1) + strlen(err2) + strlen(err3) +
|
||||
+ strlen(ctx->core.name) + 1;
|
||||
+ perr = XtStackAlloc(len, error_buf);
|
||||
+ if (perr != NULL) {
|
||||
+ (void) sprintf(perr, "%s%s%s%s", err1, ctx->core.name, err2, err3);
|
||||
+ XtAppWarning(XtWidgetToApplicationContext(new), perr);
|
||||
+ XtStackFree(perr, error_buf);
|
||||
+ }
|
||||
ctx->text.scroll_horiz = XawtextScrollNever;
|
||||
}
|
||||
else if ( (ctx->text.resize == XawtextResizeWidth) ||
|
||||
(ctx->text.resize == XawtextResizeBoth) ) {
|
||||
- (void) sprintf(error_buf, "Xaw Text Widget %s:\n %s %s.", ctx->core.name,
|
||||
- "Horizontal scrolling not allowed with width resize.\n",
|
||||
- "Horizontal scrolling has been DEACTIVATED.");
|
||||
- XtAppWarning(XtWidgetToApplicationContext(new), error_buf);
|
||||
+ char *err1 = "Xaw Text Widget ";
|
||||
+ char *err2 = ":\nHorizontal scrolling not allowed with width resize.\n";
|
||||
+ char *err3 = "Horizontal scrolling has been DEACTIVATED.";
|
||||
+ len = strlen(err1) + strlen(err2) + strlen(err3) +
|
||||
+ strlen(ctx->core.name) + 1;
|
||||
+ perr = XtStackAlloc(len, error_buf);
|
||||
+ if (perr != NULL) {
|
||||
+ (void) sprintf(perr, "%s%s%s%s", err1, ctx->core.name, err2, err3);
|
||||
+ XtAppWarning(XtWidgetToApplicationContext(new), perr);
|
||||
+ XtStackFree(perr, error_buf);
|
||||
+ }
|
||||
ctx->text.scroll_horiz = XawtextScrollNever;
|
||||
}
|
||||
else if (ctx->text.scroll_horiz == XawtextScrollAlways)
|
||||
--- xaw3d-1.3.orig/lib/Xaw3d/TextPop.c
|
||||
+++ xaw3d-1.3/lib/Xaw3d/TextPop.c
|
||||
@@ -27,6 +27,8 @@
|
||||
|
||||
*/
|
||||
|
||||
+/* $XFree86: xc/lib/Xaw/TextPop.c,v 1.1.1.2.4.2 1998/05/18 14:08:43 dawes Exp $ */
|
||||
+
|
||||
/************************************************************
|
||||
*
|
||||
* This file is broken up into three sections one dealing with
|
||||
@@ -64,6 +66,8 @@
|
||||
#include <X11/Xos.h> /* for O_RDONLY */
|
||||
#include <errno.h>
|
||||
|
||||
+#include "XawAlloc.h"
|
||||
+
|
||||
#ifdef X_NOT_STDC_ENV
|
||||
extern int errno;
|
||||
#endif
|
||||
@@ -805,6 +809,8 @@
|
||||
struct SearchAndReplace * search;
|
||||
{
|
||||
char msg[BUFSIZ];
|
||||
+ char *pmsg;
|
||||
+ int len;
|
||||
Widget tw = XtParent(search->search_popup);
|
||||
XawTextPosition pos;
|
||||
XawTextScanDirection dir;
|
||||
@@ -828,9 +834,20 @@
|
||||
/* The Raw string in find.ptr may be WC I can't use here, so I re - call
|
||||
GetString to get a tame version. */
|
||||
|
||||
- if (pos == XawTextSearchError)
|
||||
- (void) sprintf( msg, "Could not find string ``%s''.", GetString( search->search_text ) );
|
||||
- else {
|
||||
+ if (pos == XawTextSearchError) {
|
||||
+ char *msg1 = "Could not find string ``";
|
||||
+ char *msg2 = "''.";
|
||||
+ len = strlen(msg1) + strlen(msg2) +
|
||||
+ strlen(GetString( search->search_text )) + 1;
|
||||
+ pmsg = XtStackAlloc(len, msg);
|
||||
+ if (pmsg != NULL) {
|
||||
+ (void) sprintf( pmsg, "%s%s%s", msg1, GetString( search->search_text ),
|
||||
+ msg2);
|
||||
+ } else {
|
||||
+ pmsg = msg;
|
||||
+ (void) sprintf( pmsg, "Could not find string");
|
||||
+ }
|
||||
+ } else {
|
||||
if (dir == XawsdRight)
|
||||
XawTextSetInsertionPoint( tw, pos + text.length);
|
||||
else
|
||||
@@ -842,7 +859,8 @@
|
||||
}
|
||||
|
||||
XawTextUnsetSelection(tw);
|
||||
- SetSearchLabels(search, msg, "", TRUE);
|
||||
+ SetSearchLabels(search, pmsg, "", TRUE);
|
||||
+ XtStackFree(pmsg, msg);
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
@@ -969,13 +987,26 @@
|
||||
if ( (new_pos == XawTextSearchError) ) {
|
||||
if (count == 0) {
|
||||
char msg[BUFSIZ];
|
||||
+ char *pmsg;
|
||||
+ int len;
|
||||
+ char *msg1 = "*** Error: Could not find string ``";
|
||||
+ char *msg2 = "''. ***";
|
||||
|
||||
/* The Raw string in find.ptr may be WC I can't use here,
|
||||
so I call GetString to get a tame version.*/
|
||||
|
||||
- (void) sprintf( msg, "%s %s %s", "*** Error: Could not find string ``",
|
||||
- GetString( search->search_text ), "''. ***");
|
||||
- SetSearchLabels(search, msg, "", TRUE);
|
||||
+ len = strlen(msg1) + strlen(msg2) +
|
||||
+ strlen(GetString( search->search_text )) + 1;
|
||||
+ pmsg = XtStackAlloc(len, msg);
|
||||
+ if (pmsg != NULL) {
|
||||
+ (void) sprintf( pmsg, "%s%s%s", msg1,
|
||||
+ GetString( search->search_text ), msg2);
|
||||
+ } else {
|
||||
+ pmsg = msg;
|
||||
+ (void) sprintf(pmsg, "*** Error: Could not find string ***");
|
||||
+ }
|
||||
+ SetSearchLabels(search, pmsg, "", TRUE);
|
||||
+ XtStackFree(pmsg, msg);
|
||||
return(FALSE);
|
||||
}
|
||||
else
|
||||
@@ -998,9 +1029,22 @@
|
||||
|
||||
if (XawTextReplace(tw, pos, end_pos, &replace) != XawEditDone) {
|
||||
char msg[BUFSIZ];
|
||||
-
|
||||
- (void) sprintf( msg, "'%s' with '%s'. ***", find.ptr, replace.ptr);
|
||||
+ char *pmsg;
|
||||
+ int len;
|
||||
+ char *msg1 = "' with '";
|
||||
+ char *msg2 = "'. ***";
|
||||
+
|
||||
+ len = 1 + strlen(msg1) + strlen(msg2) + strlen(find.ptr) +
|
||||
+ strlen(replace.ptr) + 1;
|
||||
+ pmsg = XtStackAlloc(len, msg);
|
||||
+ if (pmsg != NULL) {
|
||||
+ (void) sprintf( pmsg, "`%s%s%s%s", find.ptr, msg1, replace.ptr, msg2);
|
||||
+ } else {
|
||||
+ pmsg = msg;
|
||||
+ (void) sprintf(pmsg, "string ***");
|
||||
+ }
|
||||
SetSearchLabels(search, "*** Error while replacing", msg, TRUE);
|
||||
+ XtStackFree(pmsg, msg);
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
@@ -1151,13 +1195,20 @@
|
||||
{
|
||||
Widget temp_widget;
|
||||
char buf[BUFSIZ];
|
||||
+ char *pbuf;
|
||||
+ int len;
|
||||
|
||||
- (void) sprintf(buf, "%s.%s", FORM_NAME, name);
|
||||
+ len = strlen(FORM_NAME) + strlen(name) + 2;
|
||||
+ pbuf = XtStackAlloc(len, buf);
|
||||
+ if (pbuf == NULL) return FALSE;
|
||||
+ (void) sprintf(pbuf, "%s.%s", FORM_NAME, name);
|
||||
|
||||
- if ( (temp_widget = XtNameToWidget(shell, buf)) != NULL) {
|
||||
+ if ( (temp_widget = XtNameToWidget(shell, pbuf)) != NULL) {
|
||||
SetResource(temp_widget, res_name, value);
|
||||
+ XtStackFree(pbuf, buf);
|
||||
return(TRUE);
|
||||
}
|
||||
+ XtStackFree(pbuf, buf);
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
--- xaw3d-1.3.orig/lib/Xaw3d/TextSrc.c
|
||||
+++ xaw3d-1.3/lib/Xaw3d/TextSrc.c
|
||||
@@ -26,6 +26,8 @@
|
||||
|
||||
*/
|
||||
|
||||
+/* $XFree86: xc/lib/Xaw/TextSrc.c,v 1.1.1.1.12.2 1998/05/16 09:05:22 dawes Exp $ */
|
||||
+
|
||||
/*
|
||||
* Author: Chris Peterson, MIT X Consortium.
|
||||
* Much code taken from X11R3 String and Disk Sources.
|
||||
@@ -323,6 +325,10 @@
|
||||
inited = TRUE;
|
||||
}
|
||||
|
||||
+ if (strlen((char *)fromVal->addr) >= sizeof(lowerName)) {
|
||||
+ XtStringConversionWarning((char *) fromVal->addr, XtREditMode);
|
||||
+ return;
|
||||
+ }
|
||||
XmuCopyISOLatin1Lowered (lowerName, (char *)fromVal->addr);
|
||||
q = XrmStringToQuark(lowerName);
|
||||
|
||||
@@ -330,7 +336,7 @@
|
||||
else if (q == QAppend) editType = XawtextAppend;
|
||||
else if (q == QEdit) editType = XawtextEdit;
|
||||
else {
|
||||
- done(NULL, 0);
|
||||
+ XtStringConversionWarning((char *) fromVal->addr, XtREditMode);
|
||||
return;
|
||||
}
|
||||
done(&editType, XawTextEditType);
|
||||
--- xaw3d-1.3.orig/lib/Xaw3d/XawIm.c
|
||||
+++ xaw3d-1.3/lib/Xaw3d/XawIm.c
|
||||
@@ -224,22 +224,6 @@
|
||||
return(ve->ic.input_style);
|
||||
}
|
||||
|
||||
-static XIMStyle GetInputStyleOfIM( p )
|
||||
- String p;
|
||||
-{
|
||||
- if (!p || !*p)
|
||||
- return((XIMStyle)0);
|
||||
- if (!strcmp(p, "OverTheSpot")) {
|
||||
- return((XIMPreeditPosition | XIMStatusArea));
|
||||
- } else if (!strcmp(p, "OffTheSpot")) {
|
||||
- return((XIMPreeditArea | XIMStatusArea));
|
||||
- } else if (!strcmp(p, "Root")) {
|
||||
- return((XIMPreeditNothing | XIMStatusNothing));
|
||||
- } else {
|
||||
- return((XIMStyle)0);
|
||||
- }
|
||||
-}
|
||||
-
|
||||
static void ConfigureCB( w, closure, event )
|
||||
Widget w;
|
||||
XtPointer closure;
|
||||
@@ -377,14 +361,6 @@
|
||||
if (contextErrData) XtFree((char *)contextErrData);
|
||||
}
|
||||
XDeleteContext(XtDisplay(vw), (Window)vw, extContext);
|
||||
- if (ve->im.im_list) {
|
||||
- XtFree((char *)ve->im.im_list[0]);
|
||||
- XtFree((char *)ve->im.im_list);
|
||||
- }
|
||||
- if (ve->ic.ic_list) {
|
||||
- XtFree((char *)ve->ic.ic_list[0]);
|
||||
- XtFree((char *)ve->ic.ic_list);
|
||||
- }
|
||||
if (ve->ic.shared_ic_table)
|
||||
XtFree((char *)ve->ic.shared_ic_table);
|
||||
if (ve->im.resources) XtFree((char *)ve->im.resources);
|
||||
@@ -413,25 +389,51 @@
|
||||
static void OpenIM(ve)
|
||||
XawVendorShellExtPart * ve;
|
||||
{
|
||||
- char *p, modifiers[32];
|
||||
+ int i;
|
||||
+ char *p, *s, *ns, *end, *pbuf, buf[32];
|
||||
XIM xim = NULL;
|
||||
XIMStyles *xim_styles;
|
||||
- XIMStyle input_style;
|
||||
- int i, j;
|
||||
+ XIMStyle input_style = 0;
|
||||
+ Boolean found;
|
||||
|
||||
if (ve->im.open_im == False) return;
|
||||
ve->im.xim = NULL;
|
||||
- if (ve->im.im_list_num <= 0) {
|
||||
+ if (ve->im.input_method == NULL) {
|
||||
if ((p = XSetLocaleModifiers("@im=none")) != NULL && *p)
|
||||
xim = XOpenIM(XtDisplay(ve->parent), NULL, NULL, NULL);
|
||||
} else {
|
||||
- for (i = 0; i < ve->im.im_list_num; i++) {
|
||||
- strcpy(modifiers, "@im=");
|
||||
- strcat(modifiers, ve->im.im_list[i]);
|
||||
- if ((p = XSetLocaleModifiers(modifiers)) != NULL && *p &&
|
||||
- (xim = XOpenIM(XtDisplay(ve->parent), NULL, NULL, NULL)) != NULL)
|
||||
+ /* no fragment can be longer than the whole string */
|
||||
+ int len = strlen (ve->im.input_method) + 5;
|
||||
+
|
||||
+ if (len < sizeof buf) pbuf = buf;
|
||||
+ else pbuf = XtMalloc (len);
|
||||
+
|
||||
+ if (pbuf == NULL) return;
|
||||
+
|
||||
+ for(ns=s=ve->im.input_method; ns && *s;) {
|
||||
+ /* skip any leading blanks */
|
||||
+ while (*s && isspace(*s)) s++;
|
||||
+ if (!*s) break;
|
||||
+ if ((ns = end = strchr(s, ',')) == NULL)
|
||||
+ end = s + strlen(s);
|
||||
+ /* If there is a spurious comma end can be the same as s */
|
||||
+ if (end > s) {
|
||||
+ /* strip any trailing blanks */
|
||||
+ while (isspace(*(end - 1))) end--;
|
||||
+
|
||||
+ strcpy (pbuf, "@im=");
|
||||
+ strncat (pbuf, s, end - s);
|
||||
+ pbuf[end - s + 4] = '\0';
|
||||
+ }
|
||||
+
|
||||
+ if ((p = XSetLocaleModifiers(pbuf)) != NULL && *p
|
||||
+ && (xim = XOpenIM(XtDisplay(ve->parent), NULL, NULL, NULL)) != NULL)
|
||||
break;
|
||||
+
|
||||
+ s = ns + 1;
|
||||
}
|
||||
+
|
||||
+ if (pbuf != buf) XtFree (pbuf);
|
||||
}
|
||||
if (xim == NULL) {
|
||||
if ((p = XSetLocaleModifiers("")) != NULL) {
|
||||
@@ -450,24 +452,42 @@
|
||||
XCloseIM(xim);
|
||||
return;
|
||||
}
|
||||
- for (j = 0; j < ve->ic.ic_list_num; j++) {
|
||||
- input_style = GetInputStyleOfIM(ve->ic.ic_list[j]);
|
||||
- if (input_style == (XIMStyle)0) continue;
|
||||
- for (i = 0; (unsigned short)i < xim_styles->count_styles; i++) {
|
||||
+ found = False;
|
||||
+ for(ns = s = ve->im.preedit_type; s && !found;) {
|
||||
+ while (*s && isspace(*s)) s++;
|
||||
+ if (!*s) break;
|
||||
+ if ((ns = end = strchr(s, ',')) == NULL)
|
||||
+ end = s + strlen(s);
|
||||
+ else
|
||||
+ ns++;
|
||||
+ if (end > s)
|
||||
+ while (isspace(*(end - 1))) end--;
|
||||
+
|
||||
+ if (!strncmp(s, "OverTheSpot", end - s)) {
|
||||
+ input_style = (XIMPreeditPosition | XIMStatusArea);
|
||||
+ } else if (!strncmp(s, "OffTheSpot", end - s)) {
|
||||
+ input_style = (XIMPreeditArea | XIMStatusArea);
|
||||
+ } else if (!strncmp(s, "Root", end - s)) {
|
||||
+ input_style = (XIMPreeditNothing | XIMStatusNothing);
|
||||
+ }
|
||||
+ for (i = 0; (unsigned short)i < xim_styles->count_styles; i++)
|
||||
if (input_style == xim_styles->supported_styles[i]) {
|
||||
ve->ic.input_style = input_style;
|
||||
SetErrCnxt(ve->parent, xim);
|
||||
-/* _XipSetIOErrorHandler(IOErrorHandler); */
|
||||
ve->im.xim = xim;
|
||||
- XFree(xim_styles);
|
||||
- return;
|
||||
+ found = True;
|
||||
+ break;
|
||||
}
|
||||
- }
|
||||
+
|
||||
+ s = ns;
|
||||
}
|
||||
- XCloseIM(xim);
|
||||
- XtAppWarning(XtWidgetToApplicationContext(ve->parent),
|
||||
- "input method doesn't support my input style");
|
||||
XFree(xim_styles);
|
||||
+
|
||||
+ if (!found) {
|
||||
+ XCloseIM(xim);
|
||||
+ XtAppWarning(XtWidgetToApplicationContext(ve->parent),
|
||||
+ "input method doesn't support my input style");
|
||||
+ }
|
||||
}
|
||||
|
||||
static Boolean ResizeVendorShell_Core(vw, ve, p)
|
||||
@@ -1313,48 +1333,6 @@
|
||||
#undef xrmres
|
||||
}
|
||||
|
||||
-
|
||||
-static char** ParseIMNameList(p, num)
|
||||
- char* p;
|
||||
- int* num;
|
||||
-{
|
||||
- char *s, *save_s, *ss, *list[32], **lp, *end;
|
||||
- int i = 0;
|
||||
-
|
||||
- *num = 0;
|
||||
- if (!p || !*p) return ((char **)NULL);
|
||||
- while (*p && isspace(*p)) p++;
|
||||
- if (!*p) return ((char **)NULL);
|
||||
- if ((s = XtMalloc(strlen(p) + 1)) == NULL) return((char **)NULL);
|
||||
- strcpy(s, p);
|
||||
- save_s = s;
|
||||
-
|
||||
- while(1) {
|
||||
- list[i] = s;
|
||||
- ss = index(s, ',');
|
||||
- if (!ss) {
|
||||
- end = s + strlen(s);
|
||||
- } else {
|
||||
- end = ss;
|
||||
- }
|
||||
- while (isspace(*end)) end--;
|
||||
- *end = '\0';
|
||||
- i++;
|
||||
- if (!ss) break;
|
||||
- s = ss + 1;
|
||||
- while (*s && isspace(*s)) p++;
|
||||
- if (!*s) break;
|
||||
- }
|
||||
- if ((lp = (char **)XtMalloc(sizeof(char *) * (i + 1))) == NULL) {
|
||||
- XtFree(save_s);
|
||||
- return((char **)NULL);
|
||||
- }
|
||||
- memcpy((char *)lp, (char *)list, sizeof(char *) * i);
|
||||
- *(lp + i) = NULL;
|
||||
- *num = i;
|
||||
- return(lp);
|
||||
-}
|
||||
-
|
||||
static Boolean Initialize( vw, ve )
|
||||
VendorShellWidget vw;
|
||||
XawVendorShellExtPart* ve;
|
||||
@@ -1375,10 +1353,6 @@
|
||||
return(FALSE);
|
||||
ve->ic.current_ic_table = NULL;
|
||||
ve->ic.ic_table = NULL;
|
||||
- ve->im.im_list = ParseIMNameList(ve->im.input_method, &i);
|
||||
- ve->im.im_list_num = i;
|
||||
- ve->ic.ic_list = ParseIMNameList(ve->im.preedit_type, &i);
|
||||
- ve->ic.ic_list_num = i;
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
@@ -1676,10 +1650,10 @@
|
||||
|
||||
if ((vw = SearchVendorShell(inwidg)) && (ve = GetExtPart(vw)) &&
|
||||
ve->im.xim && (p = GetIcTableShared(inwidg, ve)) && p->xic) {
|
||||
- return(XwcLookupString(p->xic, event, buffer_return, bytes_buffer,
|
||||
+ return(XwcLookupString(p->xic, event, buffer_return, bytes_buffer/sizeof(wchar_t),
|
||||
keysym_return, status_return));
|
||||
}
|
||||
- ret = XLookupString( event, tmp_buf, 64, keysym_return,
|
||||
+ ret = XLookupString( event, tmp_buf, sizeof(tmp_buf), keysym_return,
|
||||
(XComposeStatus*) status_return );
|
||||
for ( i = 0, tmp_p = tmp_buf, buf_p = buffer_return; i < ret; i++ ) {
|
||||
*buf_p++ = _Xaw_atowc(*tmp_p++);
|
||||
--- xaw3d-1.3.orig/lib/Xaw3d/XawImP.h
|
||||
+++ xaw3d-1.3/lib/Xaw3d/XawImP.h
|
||||
@@ -85,8 +85,6 @@
|
||||
Dimension area_height;
|
||||
String input_method;
|
||||
String preedit_type;
|
||||
- String *im_list;
|
||||
- Cardinal im_list_num;
|
||||
} XawImPart;
|
||||
|
||||
typedef struct _XawIcTablePart
|
||||
@@ -109,8 +107,6 @@
|
||||
|
||||
typedef struct _XawIcPart
|
||||
{
|
||||
- String *ic_list;
|
||||
- Cardinal ic_list_num;
|
||||
XIMStyle input_style;
|
||||
Boolean shared_ic;
|
||||
XawIcTableList shared_ic_table;
|
||||
--- xaw3d-1.3.orig/lib/Xaw3d/XawAlloc.h
|
||||
+++ xaw3d-1.3/lib/Xaw3d/XawAlloc.h
|
||||
@@ -0,0 +1,10 @@
|
||||
+/* $XFree86: xc/lib/Xaw/XawAlloc.h,v 1.1.2.1 1998/05/16 09:05:23 dawes Exp $ */
|
||||
+
|
||||
+#define XtStackAlloc(size, stack_cache_array) \
|
||||
+ ((size) <= sizeof(stack_cache_array) \
|
||||
+ ? (XtPointer)(stack_cache_array) \
|
||||
+ : XtMalloc((unsigned)(size)))
|
||||
+
|
||||
+#define XtStackFree(pointer, stack_cache_array) \
|
||||
+ if ((pointer) != ((XtPointer)(stack_cache_array))) XtFree(pointer); else
|
||||
+
|
||||
--- xaw3d-1.3.orig/lib/Xaw3d/laygram.h
|
||||
+++ xaw3d-1.3/lib/Xaw3d/laygram.h
|
||||
@@ -0,0 +1,36 @@
|
||||
+typedef union {
|
||||
+ int ival;
|
||||
+ XrmQuark qval;
|
||||
+ BoxPtr bval;
|
||||
+ BoxParamsPtr pval;
|
||||
+ GlueRec gval;
|
||||
+ LayoutDirection lval;
|
||||
+ ExprPtr eval;
|
||||
+ Operator oval;
|
||||
+} YYSTYPE;
|
||||
+#define OC 258
|
||||
+#define CC 259
|
||||
+#define OA 260
|
||||
+#define CA 261
|
||||
+#define OP 262
|
||||
+#define CP 263
|
||||
+#define NAME 264
|
||||
+#define NUMBER 265
|
||||
+#define INFINITY 266
|
||||
+#define VERTICAL 267
|
||||
+#define HORIZONTAL 268
|
||||
+#define EQUAL 269
|
||||
+#define DOLLAR 270
|
||||
+#define PLUS 271
|
||||
+#define MINUS 272
|
||||
+#define TIMES 273
|
||||
+#define DIVIDE 274
|
||||
+#define PERCENTOF 275
|
||||
+#define PERCENT 276
|
||||
+#define WIDTH 277
|
||||
+#define HEIGHT 278
|
||||
+#define UMINUS 279
|
||||
+#define UPLUS 280
|
||||
+
|
||||
+
|
||||
+extern YYSTYPE LayYYlval;
|
||||
@ -1,21 +0,0 @@
|
||||
--- Xaw3d-1.3/xc/lib/Xaw3d/XawI18n.h.orig Tue Aug 29 07:00:21 1995
|
||||
+++ Xaw3d-1.3/xc/lib/Xaw3d/XawI18n.h Tue Nov 19 02:22:09 1996
|
||||
@@ -27,12 +27,18 @@
|
||||
|
||||
********************************************************/
|
||||
|
||||
+#if 0
|
||||
#ifdef HAS_WCTYPE_H
|
||||
#include <wctype.h>
|
||||
+#if !defined(__linux__)
|
||||
#include <widec.h>
|
||||
+#endif
|
||||
+#endif
|
||||
#define wcslen(c) wslen(c)
|
||||
#define wcscpy(d,s) wscpy(d,s)
|
||||
#define wcsncpy(d,s,l) wsncpy(d,s,l)
|
||||
+#if 0
|
||||
+#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAS_WCHAR_H
|
||||
@ -1,10 +0,0 @@
|
||||
--- xc/lib/Xaw3d/Scrollbar.c.orig 2004-11-30 14:41:09.032348461 +0100
|
||||
+++ xc/lib/Xaw3d/Scrollbar.c 2004-11-30 14:41:37.213698771 +0100
|
||||
@@ -1252,6 +1252,6 @@
|
||||
sbw->scrollbar.shown = (shown > 1.0) ? 1.0 :
|
||||
(shown >= 0.0) ? shown : sbw->scrollbar.shown;
|
||||
|
||||
- PaintThumb (sbw);
|
||||
+ PaintThumb (sbw, NULL);
|
||||
}
|
||||
|
||||
27
Xaw3d-1.5-box.c.patch
Normal file
27
Xaw3d-1.5-box.c.patch
Normal file
@ -0,0 +1,27 @@
|
||||
#! /bin/sh /usr/share/dpatch/dpatch-run
|
||||
## box.c.dpatch by Francesco Paolo Lovergine <frankie@debian.org>
|
||||
##
|
||||
## All lines beginning with `## DP:' are a description of the patch.
|
||||
## DP: No description.
|
||||
|
||||
@DPATCH@
|
||||
diff -urNad xaw3d-1.5+E~/lib/Xaw3d/Box.c xaw3d-1.5+E/lib/Xaw3d/Box.c
|
||||
--- Xaw3d-1.5E/xc/lib/Xaw3d/Box.c 1996-10-15 16:41:18.000000000 +0200
|
||||
+++ Xaw3d-1.5E/xc/lib/Xaw3d/Box.c 2007-04-24 15:28:39.000000000 +0200
|
||||
@@ -353,8 +353,16 @@
|
||||
else {
|
||||
width = preferred_width;
|
||||
do { /* find some width big enough to stay within this height */
|
||||
+#if 0
|
||||
width *= 2;
|
||||
if (width > constraint->width) width = constraint->width;
|
||||
+#endif
|
||||
+ if (width > constraint->width/2) { /* avoid short int overflow */
|
||||
+ width = constraint->width;
|
||||
+ }
|
||||
+ else {
|
||||
+ width *= 2;
|
||||
+ }
|
||||
DoLayout(w, width, 0, &preferred_width, &preferred_height, FALSE);
|
||||
} while (preferred_height > constraint->height &&
|
||||
width < constraint->width);
|
||||
647
Xaw3d-1.5-debian-fixes.patch
Normal file
647
Xaw3d-1.5-debian-fixes.patch
Normal file
@ -0,0 +1,647 @@
|
||||
diff -up Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrc.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrc.c
|
||||
--- Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrc.c.debian 2000-11-27 14:19:36.000000000 +0100
|
||||
+++ Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrc.c 2008-10-06 11:42:13.000000000 +0200
|
||||
@@ -51,11 +51,17 @@ in this Software without prior written a
|
||||
#include <X11/Xaw3d/MultiSrcP.h>
|
||||
#endif
|
||||
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/stat.h>
|
||||
+#include <fcntl.h>
|
||||
|
||||
#if (defined(ASCII_STRING) || defined(ASCII_DISK))
|
||||
# include <X11/Xaw3d/AsciiText.h> /* for Widget Classes. */
|
||||
#endif
|
||||
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/stat.h>
|
||||
+#include <fcntl.h>
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
@@ -1007,7 +1013,9 @@ InitStringOrFile(src, newString)
|
||||
AsciiSrcObject src;
|
||||
Boolean newString;
|
||||
{
|
||||
- char * open_mode = NULL;
|
||||
+ mode_t open_mode = 0;
|
||||
+ const char *fdopen_mode = NULL;
|
||||
+ int fd;
|
||||
FILE * file;
|
||||
char fileName[TMPSIZ];
|
||||
|
||||
@@ -1049,7 +1057,8 @@ Boolean newString;
|
||||
XtErrorMsg("NoFile", "asciiSourceCreate", "XawError",
|
||||
"Creating a read only disk widget and no file specified.",
|
||||
NULL, 0);
|
||||
- open_mode = "r";
|
||||
+ open_mode = O_RDONLY;
|
||||
+ fdopen_mode = "r";
|
||||
break;
|
||||
case XawtextAppend:
|
||||
case XawtextEdit:
|
||||
@@ -1057,9 +1066,17 @@ Boolean newString;
|
||||
src->ascii_src.string = fileName;
|
||||
(void) tmpnam(src->ascii_src.string);
|
||||
src->ascii_src.is_tempfile = TRUE;
|
||||
- open_mode = "w";
|
||||
- } else
|
||||
- open_mode = "r+";
|
||||
+ open_mode = O_WRONLY | O_CREAT | O_EXCL;
|
||||
+ fdopen_mode = "w";
|
||||
+ } else {
|
||||
+/* O_NOFOLLOW is a BSD & Linux extension */
|
||||
+#ifdef O_NOFOLLOW
|
||||
+ open_mode = O_RDWR | O_NOFOLLOW;
|
||||
+#else
|
||||
+ open_mode = O_RDWR; /* unsafe; subject to race conditions */
|
||||
+#endif
|
||||
+ fdopen_mode = "r+";
|
||||
+ }
|
||||
break;
|
||||
default:
|
||||
XtErrorMsg("badMode", "asciiSourceCreate", "XawError",
|
||||
@@ -1078,11 +1095,14 @@ Boolean newString;
|
||||
}
|
||||
|
||||
if (!src->ascii_src.is_tempfile) {
|
||||
- if ((file = fopen(src->ascii_src.string, open_mode)) != 0) {
|
||||
- (void) fseek(file, (Off_t)0, 2);
|
||||
- src->ascii_src.length = (XawTextPosition) ftell(file);
|
||||
- return file;
|
||||
- } else {
|
||||
+ if ((fd = open(src->ascii_src.string, open_mode, 0666))) {
|
||||
+ if ((file = fdopen(fd, fdopen_mode)) != NULL) {
|
||||
+ (void)fseek(file, 0, SEEK_END);
|
||||
+ src->ascii_src.length = (XawTextPosition)ftell(file);
|
||||
+ return (file);
|
||||
+ }
|
||||
+ }
|
||||
+ {
|
||||
String params[2];
|
||||
Cardinal num_params = 2;
|
||||
|
||||
@@ -1094,7 +1114,7 @@ Boolean newString;
|
||||
}
|
||||
}
|
||||
src->ascii_src.length = 0;
|
||||
- return((FILE *)NULL);
|
||||
+ return(NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
diff -up Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrcP.h.debian Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrcP.h
|
||||
--- Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrcP.h.debian 1996-10-15 16:41:18.000000000 +0200
|
||||
+++ Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrcP.h 2008-10-06 11:42:13.000000000 +0200
|
||||
@@ -85,7 +85,11 @@ SOFTWARE.
|
||||
#ifdef L_tmpnam
|
||||
#define TMPSIZ L_tmpnam
|
||||
#else
|
||||
-#define TMPSIZ 32 /* bytes to allocate for tmpnam */
|
||||
+#ifdef PATH_MAX
|
||||
+#define TMPSIZ PATH_MAX
|
||||
+#else
|
||||
+#define TMPSIZ 1024 /* bytes to allocate for tmpnam */
|
||||
+#endif
|
||||
#endif
|
||||
|
||||
#define MAGIC_VALUE ((XawTextPosition) -1) /* Magic value. */
|
||||
diff -up Xaw3d-1.5E/xc/lib/Xaw3d/MenuButton.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/MenuButton.c
|
||||
--- Xaw3d-1.5E/xc/lib/Xaw3d/MenuButton.c.debian 1996-10-15 16:41:20.000000000 +0200
|
||||
+++ Xaw3d-1.5E/xc/lib/Xaw3d/MenuButton.c 2008-10-06 11:42:13.000000000 +0200
|
||||
@@ -53,6 +53,8 @@ in this Software without prior written a
|
||||
#include <X11/Xaw3d/XawInit.h>
|
||||
#include <X11/Xaw3d/MenuButtoP.h>
|
||||
|
||||
+#include "XawAlloc.h"
|
||||
+
|
||||
static void ClassInitialize();
|
||||
static void PopupMenu();
|
||||
|
||||
@@ -179,9 +181,16 @@ Cardinal * num_params;
|
||||
|
||||
if (menu == NULL) {
|
||||
char error_buf[BUFSIZ];
|
||||
- (void) sprintf(error_buf, "MenuButton: %s %s.",
|
||||
- "Could not find menu widget named", mbw->menu_button.menu_name);
|
||||
- XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
|
||||
+ char *err1 = "MenuButton: Could not find menu widget named ";
|
||||
+ char *perr;
|
||||
+ int len;
|
||||
+
|
||||
+ len = strlen(err1) + strlen(mbw->menu_button.menu_name) + 1 + 1;
|
||||
+ perr = XtStackAlloc(len, error_buf);
|
||||
+ if (perr == NULL) return;
|
||||
+ sprintf(perr, "%s%s.", err1, mbw->menu_button.menu_name);
|
||||
+ XtAppWarning(XtWidgetToApplicationContext(w), perr);
|
||||
+ XtStackFree(perr, error_buf);
|
||||
return;
|
||||
}
|
||||
if (!XtIsRealized(menu))
|
||||
diff -up Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrc.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrc.c
|
||||
--- Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrc.c.debian 2008-10-06 11:42:13.000000000 +0200
|
||||
+++ Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrc.c 2008-10-06 11:42:13.000000000 +0200
|
||||
@@ -74,6 +74,9 @@ in this Software without prior written a
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/stat.h>
|
||||
+#include <fcntl.h>
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
@@ -1077,7 +1080,9 @@ InitStringOrFile(src, newString)
|
||||
MultiSrcObject src;
|
||||
Boolean newString;
|
||||
{
|
||||
- char * open_mode = NULL;
|
||||
+ mode_t open_mode = 0;
|
||||
+ const char *fdopen_mode = NULL;
|
||||
+ int fd;
|
||||
FILE * file;
|
||||
char fileName[TMPSIZ];
|
||||
Display *d = XtDisplayOfObject((Widget)src);
|
||||
@@ -1128,7 +1133,8 @@ InitStringOrFile(src, newString)
|
||||
XtErrorMsg("NoFile", "multiSourceCreate", "XawError",
|
||||
"Creating a read only disk widget and no file specified.",
|
||||
NULL, 0);
|
||||
- open_mode = "r";
|
||||
+ open_mode = O_RDONLY;
|
||||
+ fdopen_mode = "r";
|
||||
break;
|
||||
case XawtextAppend:
|
||||
case XawtextEdit:
|
||||
@@ -1141,9 +1147,17 @@ InitStringOrFile(src, newString)
|
||||
|
||||
(void) tmpnam(src->multi_src.string);
|
||||
src->multi_src.is_tempfile = TRUE;
|
||||
- open_mode = "w";
|
||||
- } else
|
||||
- open_mode = "r+";
|
||||
+ open_mode = O_WRONLY | O_CREAT | O_EXCL;
|
||||
+ fdopen_mode = "w";
|
||||
+ } else {
|
||||
+/* O_NOFOLLOW is a BSD & Linux extension */
|
||||
+#ifdef O_NOFOLLOW
|
||||
+ open_mode = O_RDWR | O_NOFOLLOW;
|
||||
+#else
|
||||
+ open_mode = O_RDWR; /* unsafe; subject to race conditions */
|
||||
+#endif
|
||||
+ fdopen_mode = "r+";
|
||||
+ }
|
||||
break;
|
||||
default:
|
||||
XtErrorMsg("badMode", "multiSourceCreate", "XawError",
|
||||
@@ -1162,11 +1176,14 @@ InitStringOrFile(src, newString)
|
||||
}
|
||||
|
||||
if (!src->multi_src.is_tempfile) {
|
||||
- if ((file = fopen(src->multi_src.string, open_mode)) != 0) {
|
||||
- (void) fseek(file, (Off_t)0, 2);
|
||||
- src->multi_src.length = ftell (file);
|
||||
- return file;
|
||||
- } else {
|
||||
+ if ((fd = open(src->multi_src.string, open_mode, 0666))) {
|
||||
+ if ((file = fdopen(fd, fdopen_mode)) != NULL) {
|
||||
+ (void)fseek(file, 0, SEEK_END);
|
||||
+ src->multi_src.length = (XawTextPosition)ftell(file);
|
||||
+ return (file);
|
||||
+ }
|
||||
+ }
|
||||
+ {
|
||||
String params[2];
|
||||
Cardinal num_params = 2;
|
||||
|
||||
@@ -1178,7 +1195,7 @@ InitStringOrFile(src, newString)
|
||||
}
|
||||
}
|
||||
src->multi_src.length = 0;
|
||||
- return((FILE *)NULL);
|
||||
+ return(NULL);
|
||||
#undef StrLen
|
||||
}
|
||||
|
||||
diff -up Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrcP.h.debian Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrcP.h
|
||||
--- Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrcP.h.debian 1996-10-15 16:41:21.000000000 +0200
|
||||
+++ Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrcP.h 2008-10-06 11:42:13.000000000 +0200
|
||||
@@ -113,7 +113,11 @@ SOFTWARE.
|
||||
#ifdef L_tmpnam
|
||||
#define TMPSIZ L_tmpnam
|
||||
#else
|
||||
-#define TMPSIZ 32 /* bytes to allocate for tmpnam */
|
||||
+#ifdef PATH_MAX
|
||||
+#define TMPSIZ PATH_MAX
|
||||
+#else
|
||||
+#define TMPSIZ 1024 /* bytes to allocate for tmpnam */
|
||||
+#endif
|
||||
#endif
|
||||
|
||||
#define MAGIC_VALUE ((XawTextPosition) -1) /* Magic value. */
|
||||
diff -up Xaw3d-1.5E/xc/lib/Xaw3d/Simple.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/Simple.c
|
||||
--- Xaw3d-1.5E/xc/lib/Xaw3d/Simple.c.debian 2000-11-27 14:19:36.000000000 +0100
|
||||
+++ Xaw3d-1.5E/xc/lib/Xaw3d/Simple.c 2008-10-06 11:42:13.000000000 +0200
|
||||
@@ -56,6 +56,8 @@ SOFTWARE.
|
||||
#include <X11/Xaw3d/SimpleP.h>
|
||||
#include <X11/Xmu/Drawing.h>
|
||||
|
||||
+#include "XawAlloc.h"
|
||||
+
|
||||
#define offset(field) XtOffsetOf(SimpleRec, simple.field)
|
||||
|
||||
static XtResource resources[] = {
|
||||
@@ -148,11 +150,17 @@ static void ClassPartInitialize(class)
|
||||
|
||||
if (c->simple_class.change_sensitive == NULL) {
|
||||
char buf[BUFSIZ];
|
||||
-
|
||||
- (void) sprintf(buf,
|
||||
- "%s Widget: The Simple Widget class method 'change_sensitive' is undefined.\nA function must be defined or inherited.",
|
||||
- c->core_class.class_name);
|
||||
- XtWarning(buf);
|
||||
+ char *pbuf;
|
||||
+ char *msg1 = " Widget: The Simple Widget class method 'change_sensitive' is undefined.\nA function must be defined or inherited.";
|
||||
+ int len;
|
||||
+
|
||||
+ len = strlen(msg1) + strlen(c->core_class.class_name) + 1;
|
||||
+ pbuf = XtStackAlloc(len, buf);
|
||||
+ if (pbuf != NULL) {
|
||||
+ sprintf(pbuf, "%s%s", c->core_class.class_name, msg1);
|
||||
+ XtWarning(pbuf);
|
||||
+ XtStackFree(pbuf, buf);
|
||||
+ }
|
||||
c->simple_class.change_sensitive = ChangeSensitive;
|
||||
}
|
||||
|
||||
diff -up Xaw3d-1.5E/xc/lib/Xaw3d/SimpleMenu.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/SimpleMenu.c
|
||||
--- Xaw3d-1.5E/xc/lib/Xaw3d/SimpleMenu.c.debian 2003-02-17 07:45:07.000000000 +0100
|
||||
+++ Xaw3d-1.5E/xc/lib/Xaw3d/SimpleMenu.c 2008-10-06 11:42:13.000000000 +0200
|
||||
@@ -51,6 +51,8 @@ in this Software without prior written a
|
||||
#include <X11/Xmu/Initer.h>
|
||||
#include <X11/Xmu/CharSet.h>
|
||||
|
||||
+#include "XawAlloc.h"
|
||||
+
|
||||
#define streq(a, b) ( strcmp((a), (b)) == 0 )
|
||||
|
||||
#define offset(field) XtOffsetOf(SimpleMenuRec, simple_menu.field)
|
||||
@@ -755,9 +757,17 @@ Cardinal * num_params;
|
||||
|
||||
if ( (menu = FindMenu(w, params[0])) == NULL) {
|
||||
char error_buf[BUFSIZ];
|
||||
- (void) sprintf(error_buf, "%s '%s'",
|
||||
- "Xaw - SimpleMenuWidget: could not find menu named: ", params[0]);
|
||||
- XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
|
||||
+ char *err1 = "Xaw - SimpleMenuWidget: could not find menu named: ";
|
||||
+ char *perr;
|
||||
+ int len;
|
||||
+
|
||||
+ len = strlen(err1) + strlen(params[0]) + 2 + 1;
|
||||
+ perr = XtStackAlloc(len, error_buf);
|
||||
+ if (perr == NULL)
|
||||
+ return;
|
||||
+ sprintf(perr, "%s'%s'", err1, params[0]);
|
||||
+ XtAppWarning(XtWidgetToApplicationContext(w), perr);
|
||||
+ XtStackFree(perr, error_buf);
|
||||
return;
|
||||
}
|
||||
|
||||
diff -up Xaw3d-1.5E/xc/lib/Xaw3d/StripChart.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/StripChart.c
|
||||
--- Xaw3d-1.5E/xc/lib/Xaw3d/StripChart.c.debian 2003-02-10 18:18:00.000000000 +0100
|
||||
+++ Xaw3d-1.5E/xc/lib/Xaw3d/StripChart.c 2008-10-06 11:42:13.000000000 +0200
|
||||
@@ -315,7 +315,15 @@ XtIntervalId *id; /* unused */
|
||||
if (w->strip_chart.points != NULL) {
|
||||
w->strip_chart.points[0].x = w->strip_chart.interval + s;
|
||||
XDrawPoints(XtDisplay(w), XtWindow(w), w->strip_chart.hiGC,
|
||||
- w->strip_chart.points, w->strip_chart.scale,
|
||||
+ /*
|
||||
+ * patch:
|
||||
+ *
|
||||
+ * w->strip_chart.points, w->strip_chart.scale,
|
||||
+ *
|
||||
+ * this to avoid a subdle bug of extra spurios scan
|
||||
+ * line in this widget.
|
||||
+ */
|
||||
+ w->strip_chart.points, w->strip_chart.scale - 1,
|
||||
CoordModePrevious);
|
||||
}
|
||||
|
||||
diff -up Xaw3d-1.5E/xc/lib/Xaw3d/Text.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/Text.c
|
||||
--- Xaw3d-1.5E/xc/lib/Xaw3d/Text.c.debian 2008-10-06 11:42:13.000000000 +0200
|
||||
+++ Xaw3d-1.5E/xc/lib/Xaw3d/Text.c 2008-10-06 11:43:16.000000000 +0200
|
||||
@@ -76,6 +76,8 @@ SOFTWARE.
|
||||
#include <ctype.h> /* for isprint() */
|
||||
#include <stdlib.h>
|
||||
|
||||
+#include "XawAlloc.h"
|
||||
+
|
||||
#ifndef MAX_LEN_CT
|
||||
#define MAX_LEN_CT 6 /* for sequence: ESC $ ( A \xx \xx */
|
||||
#endif
|
||||
@@ -521,6 +523,8 @@ Cardinal *num_args; /* unused */
|
||||
TextWidget ctx = (TextWidget) new;
|
||||
char error_buf[BUFSIZ];
|
||||
int s;
|
||||
+ char *perr; /* frankie */
|
||||
+ size_t len; /* frankie */
|
||||
|
||||
ctx->text.threeD = XtVaCreateWidget("threeD", threeDWidgetClass, new,
|
||||
XtNx, 0, XtNy, 0,
|
||||
@@ -569,10 +573,17 @@ Cardinal *num_args; /* unused */
|
||||
if (ctx->text.scroll_vert != XawtextScrollNever)
|
||||
if ( (ctx->text.resize == XawtextResizeHeight) ||
|
||||
(ctx->text.resize == XawtextResizeBoth) ) {
|
||||
- (void) sprintf(error_buf, "Xaw Text Widget %s:\n %s %s.", ctx->core.name,
|
||||
- "Vertical scrolling not allowed with height resize.\n",
|
||||
- "Vertical scrolling has been DEACTIVATED.");
|
||||
- XtAppWarning(XtWidgetToApplicationContext(new), error_buf);
|
||||
+ char *err1 = "Xaw Text Widget ";
|
||||
+ char *err2 = ":\nVertical scrolling not allowed with height resize.\n";
|
||||
+ char *err3 = "Vertical scrolling has been DEACTIVATED.";
|
||||
+ len = strlen(err1) + strlen(err2) + strlen(err3) +
|
||||
+ strlen(ctx->core.name) + 1;
|
||||
+ perr = XtStackAlloc(len, error_buf);
|
||||
+ if (perr != NULL) {
|
||||
+ (void) sprintf(perr, "%s%s%s%s", err1, ctx->core.name, err2, err3);
|
||||
+ XtAppWarning(XtWidgetToApplicationContext(new), perr);
|
||||
+ XtStackFree(perr, error_buf);
|
||||
+ }
|
||||
ctx->text.scroll_vert = XawtextScrollNever;
|
||||
}
|
||||
else if (ctx->text.scroll_vert == XawtextScrollAlways)
|
||||
@@ -580,18 +591,32 @@ Cardinal *num_args; /* unused */
|
||||
|
||||
if (ctx->text.scroll_horiz != XawtextScrollNever)
|
||||
if (ctx->text.wrap != XawtextWrapNever) {
|
||||
- (void) sprintf(error_buf, "Xaw Text Widget %s:\n %s %s.", ctx->core.name,
|
||||
- "Horizontal scrolling not allowed with wrapping active.\n",
|
||||
- "Horizontal scrolling has been DEACTIVATED.");
|
||||
- XtAppWarning(XtWidgetToApplicationContext(new), error_buf);
|
||||
+ char *err1 = "Xaw Text Widget ";
|
||||
+ char *err2 = ":\nHorizontal scrolling not allowed with wrapping active.";
|
||||
+ char *err3 = "\nHorizontal scrolling has been DEACTIVATED.";
|
||||
+ len = strlen(err1) + strlen(err2) + strlen(err3) +
|
||||
+ strlen(ctx->core.name) + 1;
|
||||
+ perr = XtStackAlloc(len, error_buf);
|
||||
+ if (perr != NULL) {
|
||||
+ (void) sprintf(perr, "%s%s%s%s", err1, ctx->core.name, err2, err3);
|
||||
+ XtAppWarning(XtWidgetToApplicationContext(new), perr);
|
||||
+ XtStackFree(perr, error_buf);
|
||||
+ }
|
||||
ctx->text.scroll_horiz = XawtextScrollNever;
|
||||
}
|
||||
else if ( (ctx->text.resize == XawtextResizeWidth) ||
|
||||
(ctx->text.resize == XawtextResizeBoth) ) {
|
||||
- (void) sprintf(error_buf, "Xaw Text Widget %s:\n %s %s.", ctx->core.name,
|
||||
- "Horizontal scrolling not allowed with width resize.\n",
|
||||
- "Horizontal scrolling has been DEACTIVATED.");
|
||||
- XtAppWarning(XtWidgetToApplicationContext(new), error_buf);
|
||||
+ char *err1 = "Xaw Text Widget ";
|
||||
+ char *err2 = ":\nHorizontal scrolling not allowed with width resize.\n";
|
||||
+ char *err3 = "Horizontal scrolling has been DEACTIVATED.";
|
||||
+ len = strlen(err1) + strlen(err2) + strlen(err3) +
|
||||
+ strlen(ctx->core.name) + 1;
|
||||
+ perr = XtStackAlloc(len, error_buf);
|
||||
+ if (perr != NULL) {
|
||||
+ (void) sprintf(perr, "%s%s%s%s", err1, ctx->core.name, err2, err3);
|
||||
+ XtAppWarning(XtWidgetToApplicationContext(new), perr);
|
||||
+ XtStackFree(perr, error_buf);
|
||||
+ }
|
||||
ctx->text.scroll_horiz = XawtextScrollNever;
|
||||
}
|
||||
else if (ctx->text.scroll_horiz == XawtextScrollAlways)
|
||||
diff -up Xaw3d-1.5E/xc/lib/Xaw3d/TextPop.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/TextPop.c
|
||||
--- Xaw3d-1.5E/xc/lib/Xaw3d/TextPop.c.debian 2000-11-27 14:19:36.000000000 +0100
|
||||
+++ Xaw3d-1.5E/xc/lib/Xaw3d/TextPop.c 2008-10-06 11:42:13.000000000 +0200
|
||||
@@ -66,6 +66,8 @@ in this Software without prior written a
|
||||
#include <X11/Xos.h> /* for O_RDONLY */
|
||||
#include <errno.h>
|
||||
|
||||
+#include "XawAlloc.h"
|
||||
+
|
||||
#ifdef X_NOT_STDC_ENV
|
||||
extern int errno;
|
||||
#endif
|
||||
@@ -809,6 +811,8 @@ DoSearch(search)
|
||||
struct SearchAndReplace * search;
|
||||
{
|
||||
char msg[BUFSIZ];
|
||||
+ char *pmsg;
|
||||
+ int len;
|
||||
Widget tw = XtParent(search->search_popup);
|
||||
XawTextPosition pos;
|
||||
XawTextScanDirection dir;
|
||||
@@ -835,9 +839,20 @@ struct SearchAndReplace * search;
|
||||
/* The Raw string in find.ptr may be WC I can't use here, so I re - call
|
||||
GetString to get a tame version. */
|
||||
|
||||
- if (pos == XawTextSearchError)
|
||||
- (void) sprintf( msg, "Could not find string ``%s''.", GetString( search->search_text ) );
|
||||
- else {
|
||||
+ if (pos == XawTextSearchError) {
|
||||
+ char *msg1 = "Could not find string ``";
|
||||
+ char *msg2 = "''.";
|
||||
+ len = strlen(msg1) + strlen(msg2) +
|
||||
+ strlen(GetString( search->search_text )) + 1;
|
||||
+ pmsg = XtStackAlloc(len, msg);
|
||||
+ if (pmsg != NULL) {
|
||||
+ (void) sprintf( pmsg, "%s%s%s", msg1, GetString( search->search_text ),
|
||||
+ msg2);
|
||||
+ } else {
|
||||
+ pmsg = msg;
|
||||
+ (void) sprintf( pmsg, "Could not find string");
|
||||
+ }
|
||||
+ } else {
|
||||
if (dir == XawsdRight)
|
||||
XawTextSetInsertionPoint( tw, pos + text.length);
|
||||
else
|
||||
@@ -849,7 +864,8 @@ struct SearchAndReplace * search;
|
||||
}
|
||||
|
||||
XawTextUnsetSelection(tw);
|
||||
- SetSearchLabels(search, msg, "", TRUE);
|
||||
+ SetSearchLabels(search, pmsg, "", TRUE);
|
||||
+ XtStackFree(pmsg, msg);
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
@@ -982,13 +998,26 @@ Boolean once_only, show_current;
|
||||
if ( (new_pos == XawTextSearchError) ) {
|
||||
if (count == 0) {
|
||||
char msg[BUFSIZ];
|
||||
+ char *pmsg;
|
||||
+ int len;
|
||||
+ char *msg1 = "*** Error: Could not find string ``";
|
||||
+ char *msg2 = "''. ***";
|
||||
|
||||
/* The Raw string in find.ptr may be WC I can't use here,
|
||||
so I call GetString to get a tame version.*/
|
||||
|
||||
- (void) sprintf( msg, "%s %s %s", "*** Error: Could not find string ``",
|
||||
- GetString( search->search_text ), "''. ***");
|
||||
- SetSearchLabels(search, msg, "", TRUE);
|
||||
+ len = strlen(msg1) + strlen(msg2) +
|
||||
+ strlen(GetString( search->search_text )) + 1;
|
||||
+ pmsg = XtStackAlloc(len, msg);
|
||||
+ if (pmsg != NULL) {
|
||||
+ (void) sprintf( pmsg, "%s%s%s", msg1,
|
||||
+ GetString( search->search_text ), msg2);
|
||||
+ } else {
|
||||
+ pmsg = msg;
|
||||
+ (void) sprintf(pmsg, "*** Error: Could not find string ***");
|
||||
+ }
|
||||
+ SetSearchLabels(search, pmsg, "", TRUE);
|
||||
+ XtStackFree(pmsg, msg);
|
||||
return(FALSE);
|
||||
}
|
||||
else
|
||||
@@ -1011,9 +1040,22 @@ Boolean once_only, show_current;
|
||||
|
||||
if (XawTextReplace(tw, pos, end_pos, &replace) != XawEditDone) {
|
||||
char msg[BUFSIZ];
|
||||
-
|
||||
- (void) sprintf( msg, "'%s' with '%s'. ***", find.ptr, replace.ptr);
|
||||
+ char *pmsg;
|
||||
+ int len;
|
||||
+ char *msg1 = "' with '";
|
||||
+ char *msg2 = "'. ***";
|
||||
+
|
||||
+ len = 1 + strlen(msg1) + strlen(msg2) + strlen(find.ptr) +
|
||||
+ strlen(replace.ptr) + 1;
|
||||
+ pmsg = XtStackAlloc(len, msg);
|
||||
+ if (pmsg != NULL) {
|
||||
+ (void) sprintf( pmsg, "`%s%s%s%s", find.ptr, msg1, replace.ptr, msg2);
|
||||
+ } else {
|
||||
+ pmsg = msg;
|
||||
+ (void) sprintf(pmsg, "string ***");
|
||||
+ }
|
||||
SetSearchLabels(search, "*** Error while replacing", msg, TRUE);
|
||||
+ XtStackFree(pmsg, msg);
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
@@ -1164,13 +1206,20 @@ XtArgVal value;
|
||||
{
|
||||
Widget temp_widget;
|
||||
char buf[BUFSIZ];
|
||||
+ char *pbuf;
|
||||
+ int len;
|
||||
|
||||
- (void) sprintf(buf, "%s.%s", FORM_NAME, name);
|
||||
+ len = strlen(FORM_NAME) + strlen(name) + 2;
|
||||
+ pbuf = XtStackAlloc(len, buf);
|
||||
+ if (pbuf == NULL) return FALSE;
|
||||
+ (void) sprintf(pbuf, "%s.%s", FORM_NAME, name);
|
||||
|
||||
- if ( (temp_widget = XtNameToWidget(shell, buf)) != NULL) {
|
||||
+ if ( (temp_widget = XtNameToWidget(shell, pbuf)) != NULL) {
|
||||
SetResource(temp_widget, res_name, value);
|
||||
+ XtStackFree(pbuf, buf);
|
||||
return(TRUE);
|
||||
}
|
||||
+ XtStackFree(pbuf, buf);
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
diff -up /dev/null Xaw3d-1.5E/xc/lib/Xaw3d/XawAlloc.h
|
||||
--- /dev/null 2008-10-06 08:37:32.418005377 +0200
|
||||
+++ Xaw3d-1.5E/xc/lib/Xaw3d/XawAlloc.h 2008-10-06 11:42:13.000000000 +0200
|
||||
@@ -0,0 +1,10 @@
|
||||
+/* $XFree86: xc/lib/Xaw/XawAlloc.h,v 1.1.2.1 1998/05/16 09:05:23 dawes Exp $ */
|
||||
+
|
||||
+#define XtStackAlloc(size, stack_cache_array) \
|
||||
+ ((size) <= sizeof(stack_cache_array) \
|
||||
+ ? (XtPointer)(stack_cache_array) \
|
||||
+ : XtMalloc((unsigned)(size)))
|
||||
+
|
||||
+#define XtStackFree(pointer, stack_cache_array) \
|
||||
+ if ((pointer) != ((XtPointer)(stack_cache_array))) XtFree(pointer); else
|
||||
+
|
||||
--- xaw3d-1.5e/xc/lib/Xaw3d/SmeBSB.c 2003-08-04 17:27:58.000000000 +0200
|
||||
+++ xaw3d-1.5e/xc/lib/Xaw3d/SmeBSB.c 2003-08-07 15:02:39.000000000 +0200
|
||||
@@ -52,6 +52,8 @@
|
||||
#include <X11/Xaw3d/Cardinals.h>
|
||||
#include <stdio.h>
|
||||
|
||||
+#include "XawAlloc.h"
|
||||
+
|
||||
/* needed for abs() */
|
||||
#ifndef X_NOT_STDC_ENV
|
||||
#include <stdlib.h>
|
||||
@@ -712,6 +714,8 @@
|
||||
int x, y;
|
||||
unsigned int width, height, bw;
|
||||
char buf[BUFSIZ];
|
||||
+ char *pbuf;
|
||||
+ int len;
|
||||
|
||||
if (is_left) {
|
||||
width = height = 0;
|
||||
@@ -720,18 +724,24 @@
|
||||
if (!XGetGeometry(XtDisplayOfObject(w),
|
||||
entry->sme_bsb.left_bitmap, &root, &x, &y,
|
||||
&width, &height, &bw, &entry->sme_bsb.left_depth)) {
|
||||
- (void) sprintf(buf, "Xaw SmeBSB Object: %s %s \"%s\".",
|
||||
- "Could not get Left Bitmap",
|
||||
- "geometry information for menu entry",
|
||||
- XtName(w));
|
||||
- XtAppError(XtWidgetToApplicationContext(w), buf);
|
||||
+ char *err1 = "Xaw SmeBSB Object: Could not get Left Bitmap geometry information for menu entry ";
|
||||
+ len = strlen(err1) + strlen(XtName(w)) + 3 + 1;
|
||||
+ pbuf = XtStackAlloc(len, buf);
|
||||
+ if (pbuf == NULL) return;
|
||||
+ sprintf(pbuf, "%s\"%s\".", err1, XtName(w));
|
||||
+ XtAppError(XtWidgetToApplicationContext(w), pbuf);
|
||||
+ XtStackFree(pbuf, buf);
|
||||
}
|
||||
#ifdef NEVER
|
||||
if (entry->sme_bsb.left_depth != 1) {
|
||||
- (void) sprintf(buf, "Xaw SmeBSB Object: %s \"%s\" %s.",
|
||||
- "Left Bitmap of entry", XtName(w),
|
||||
- "is not one bit deep");
|
||||
- XtAppError(XtWidgetToApplicationContext(w), buf);
|
||||
+ char *err1 = "Xaw SmeBSB Object: Left Bitmap of entry ";
|
||||
+ char *err2 = " is not one bit deep.";
|
||||
+ len = strlen(err1) + strlen(err2) + strlen(XtName(w)) + 2 + 1;
|
||||
+ pbuf = XtStackAlloc(len, buf);
|
||||
+ if (pbuf == NULL) return;
|
||||
+ sprintf(pbuf, "%s\"%s\"%s", err1, XtName(w), err2);
|
||||
+ XtAppError(XtWidgetToApplicationContext(w), pbuf);
|
||||
+ XtStackFree(pbuf, buf);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -745,18 +755,24 @@
|
||||
if (!XGetGeometry(XtDisplayOfObject(w),
|
||||
entry->sme_bsb.right_bitmap, &root, &x, &y,
|
||||
&width, &height, &bw, &entry->sme_bsb.right_depth)) {
|
||||
- (void) sprintf(buf, "Xaw SmeBSB Object: %s %s \"%s\".",
|
||||
- "Could not get Right Bitmap",
|
||||
- "geometry information for menu entry",
|
||||
- XtName(w));
|
||||
- XtAppError(XtWidgetToApplicationContext(w), buf);
|
||||
+ char *err1 = "Xaw SmeBSB Object: Could not get Right Bitmap geometry information for menu entry ";
|
||||
+ len = strlen(err1) + strlen(XtName(w)) + 3 + 1;
|
||||
+ pbuf = XtStackAlloc(len, buf);
|
||||
+ if (pbuf == NULL) return;
|
||||
+ sprintf(pbuf, "%s\"%s\".", err1, XtName(w));
|
||||
+ XtAppError(XtWidgetToApplicationContext(w), pbuf);
|
||||
+ XtStackFree(pbuf, buf);
|
||||
}
|
||||
#ifdef NEVER
|
||||
if (entry->sme_bsb.right_depth != 1) {
|
||||
- (void) sprintf(buf, "Xaw SmeBSB Object: %s \"%s\" %s.",
|
||||
- "Right Bitmap of entry", XtName(w),
|
||||
- "is not one bit deep");
|
||||
- XtAppError(XtWidgetToApplicationContext(w), buf);
|
||||
+ char *err1 = "Xaw SmeBSB Object: Right Bitmap of entry ";
|
||||
+ char *err2 = " is not one bit deep.";
|
||||
+ len = strlen(err1) + strlen(err2) + strlen(XtName(w)) + 2 + 1;
|
||||
+ pbuf = XtStackAlloc(len, buf);
|
||||
+ if (pbuf == NULL) return;
|
||||
+ sprintf(pbuf, "%s\"%s\"%s", err1, XtName(w), err2);
|
||||
+ XtAppError(XtWidgetToApplicationContext(w), pbuf);
|
||||
+ XtStackFree(pbuf, buf);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -1,70 +0,0 @@
|
||||
--- Xaw3d-1.5/xc/lib/Xaw3d6/Scrollbar.c.orig 2003-11-26 19:38:34.000000000 +0100
|
||||
+++ Xaw3d-1.5/xc/lib/Xaw3d6/Scrollbar.c 2003-11-26 19:41:55.000000000 +0100
|
||||
@@ -300,9 +300,8 @@
|
||||
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
-_ShadowSurroundedBox (gw, event, region, xtl, ytl, xbr, ybr, out)
|
||||
+_ShadowSurroundedBox (gw, region, xtl, ytl, xbr, ybr, out)
|
||||
Widget gw;
|
||||
- XEvent *event;
|
||||
Region region;
|
||||
Dimension xtl, ytl, xbr, ybr; /* INNER corners */
|
||||
Boolean out;
|
||||
@@ -384,9 +383,7 @@
|
||||
sbw->shown. The old area is erased. The painting and
|
||||
erasing is done cleverly so that no flickering will occur. */
|
||||
|
||||
-static void PaintThumb (sbw, event)
|
||||
- ScrollbarWidget sbw;
|
||||
- XEvent *event;
|
||||
+static void PaintThumb (ScrollbarWidget sbw)
|
||||
{
|
||||
Dimension s = sbw->threeD.shadow_width;
|
||||
Position oldtop = sbw->scrollbar.topLoc;
|
||||
@@ -423,7 +420,7 @@
|
||||
if (sbw->scrollbar.orientation == XtorientHorizontal)
|
||||
{
|
||||
_ShadowSurroundedBox(
|
||||
- sbw, event,
|
||||
+ sbw,
|
||||
(Region)NULL,
|
||||
newtop + s, 2 * s,
|
||||
newbot - s, sbw->core.height - 2 * s, TRUE);
|
||||
@@ -431,7 +428,7 @@
|
||||
else
|
||||
{
|
||||
_ShadowSurroundedBox(
|
||||
- sbw, event,
|
||||
+ sbw,
|
||||
(Region)NULL,
|
||||
2 * s, newtop + s,
|
||||
sbw->core.width - 2 * s, newbot - s,
|
||||
@@ -454,8 +451,7 @@
|
||||
}
|
||||
|
||||
#ifdef ARROW_SCROLLBAR
|
||||
-static void PaintArrows (sbw)
|
||||
- ScrollbarWidget sbw;
|
||||
+static void PaintArrows (ScrollbarWidget sbw)
|
||||
{
|
||||
XPoint pt[20];
|
||||
Dimension s = sbw->threeD.shadow_width;
|
||||
@@ -761,7 +757,7 @@
|
||||
XRectInRegion (region, x, y, width, height) != RectangleOut) {
|
||||
/* Forces entire thumb to be painted. */
|
||||
sbw->scrollbar.topLoc = -(sbw->scrollbar.length + 1);
|
||||
- PaintThumb (sbw, event);
|
||||
+ PaintThumb (sbw);
|
||||
}
|
||||
#ifdef ARROW_SCROLLBAR
|
||||
/* we'd like to be region aware here!!!! */
|
||||
@@ -1165,7 +1161,7 @@
|
||||
#ifdef ARROW_SCROLLBAR
|
||||
sbw->scrollbar.scroll_mode = 2; /* indicate continuous scroll */
|
||||
#endif
|
||||
- PaintThumb (sbw, event);
|
||||
+ PaintThumb (sbw);
|
||||
XFlush (XtDisplay (w)); /* re-draw it before Notifying */
|
||||
}
|
||||
|
||||
@ -1,16 +1,18 @@
|
||||
--- Xaw3d-1.5/xc/lib/Xaw3d/List.c~ Tue Oct 15 16:41:20 1996
|
||||
+++ Xaw3d-1.5/xc/lib/Xaw3d/List.c Mon Jul 24 16:55:29 2000
|
||||
@@ -37,6 +37,7 @@
|
||||
*/
|
||||
diff -up Xaw3d-1.5E/xc/lib/Xaw3d/List.c.prototypes Xaw3d-1.5E/xc/lib/Xaw3d/List.c
|
||||
--- Xaw3d-1.5E/xc/lib/Xaw3d/List.c.prototypes 2000-11-27 14:19:36.000000000 +0100
|
||||
+++ Xaw3d-1.5E/xc/lib/Xaw3d/List.c 2008-10-06 10:11:28.000000000 +0200
|
||||
@@ -38,6 +38,7 @@ in this Software without prior written a
|
||||
|
||||
#include "Xaw3dP.h"
|
||||
#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <X11/IntrinsicP.h>
|
||||
--- Xaw3d-1.5/xc/lib/Xaw3d/MultiSink.c~ Tue Oct 15 16:41:20 1996
|
||||
+++ Xaw3d-1.5/xc/lib/Xaw3d/MultiSink.c Mon Jul 24 16:58:09 2000
|
||||
@@ -81,6 +81,7 @@
|
||||
#include <X11/StringDefs.h>
|
||||
diff -up Xaw3d-1.5E/xc/lib/Xaw3d/MultiSink.c.prototypes Xaw3d-1.5E/xc/lib/Xaw3d/MultiSink.c
|
||||
--- Xaw3d-1.5E/xc/lib/Xaw3d/MultiSink.c.prototypes 1996-10-15 16:41:20.000000000 +0200
|
||||
+++ Xaw3d-1.5E/xc/lib/Xaw3d/MultiSink.c 2008-10-06 10:10:37.000000000 +0200
|
||||
@@ -81,6 +81,7 @@ SOFTWARE.
|
||||
#include <X11/Xaw3d/TextP.h>
|
||||
#include "XawI18n.h"
|
||||
#include <stdio.h>
|
||||
@ -18,15 +20,14 @@
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef GETLASTPOS
|
||||
--- Xaw3d-1.5/xc/lib/Xaw3d/Text.c~ Thu May 14 21:03:24 1998
|
||||
+++ Xaw3d-1.5/xc/lib/Xaw3d/Text.c Mon Jul 24 17:00:54 2000
|
||||
@@ -71,6 +71,7 @@
|
||||
|
||||
diff -up Xaw3d-1.5E/xc/lib/Xaw3d/Text.c.prototypes Xaw3d-1.5E/xc/lib/Xaw3d/Text.c
|
||||
--- Xaw3d-1.5E/xc/lib/Xaw3d/Text.c.prototypes 2003-02-10 18:28:13.000000000 +0100
|
||||
+++ Xaw3d-1.5E/xc/lib/Xaw3d/Text.c 2008-10-06 10:11:11.000000000 +0200
|
||||
@@ -74,6 +74,7 @@ SOFTWARE.
|
||||
#include <X11/Xaw3d/ThreeDP.h>
|
||||
#include <X11/Xfuncs.h>
|
||||
#include <ctype.h> /* for isprint() */
|
||||
+#include <stdlib.h> /* for abs() */
|
||||
+#include <stdlib.h>
|
||||
|
||||
#ifndef MAX_LEN_CT
|
||||
#define MAX_LEN_CT 6 /* for sequence: ESC $ ( A \xx \xx */
|
||||
|
||||
|
||||
|
||||
55
Xaw3d.spec
55
Xaw3d.spec
@ -1,25 +1,18 @@
|
||||
Summary: A version of the MIT Athena widget set for X.
|
||||
Summary: A version of the MIT Athena widget set for X
|
||||
Name: Xaw3d
|
||||
Version: 1.5E
|
||||
Release: 11.1
|
||||
Release: 12%{?dist}
|
||||
Group: System Environment/Libraries
|
||||
Source: ftp://ftp.visi.com/users/hawkeyd/X/Xaw3d-%{version}.tar.gz
|
||||
Source1: ftp://ftp.x.org/contrib/widgets/Xaw3d/R6/Xaw3d-1.3.tar.gz
|
||||
Source2: Imakefile
|
||||
Patch: Xaw3d-1.5E-xorg-imake.patch
|
||||
Patch1: Xaw3d-1.3-glibc.patch
|
||||
Patch2: Xaw3d-1.3-X11R6.3.patch
|
||||
Patch3: xaw3d.patch
|
||||
Patch4: Xaw3d-1.3-misc.patch
|
||||
Patch5: Xaw3d-ia64.patch
|
||||
Patch6: Xaw3d-1.5-i18n.patch
|
||||
Patch7: Xaw3d-1.5-scrollbar2.patch
|
||||
Patch1: xaw3d.patch
|
||||
Patch2: Xaw3d-ia64.patch
|
||||
Patch3: Xaw3d-1.5-i18n.patch
|
||||
Patch4: Xaw3d-1.5-box.c.patch
|
||||
Patch5: Xaw3d-1.5-debian-fixes.patch
|
||||
License: MIT
|
||||
Prefix: /usr
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
||||
|
||||
Prereq: fileutils
|
||||
Prereq: /sbin/ldconfig
|
||||
URL: http://directory.fsf.org/project/xaw3d/
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
||||
BuildRequires: libXmu-devel
|
||||
BuildRequires: libXt-devel
|
||||
@ -42,9 +35,9 @@ the MIT Athena widget set and you'd like to incorporate a 3D look into
|
||||
those applications.
|
||||
|
||||
%package devel
|
||||
Summary: Header files and static libraries for development using Xaw3d.
|
||||
Summary: Header files and static libraries for development using Xaw3d
|
||||
Group: Development/Libraries
|
||||
Requires: %{name} = %{version}
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: libXmu-devel
|
||||
Requires: libXt-devel
|
||||
Requires: libSM-devel
|
||||
@ -63,14 +56,20 @@ You should install Xaw3d-devel if you are going to develop applications
|
||||
using the Xaw3d widget set. You'll also need to install the Xaw3d
|
||||
package.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q -c
|
||||
|
||||
# Xaw3d7
|
||||
pushd xc/lib/Xaw3d
|
||||
ln -s .. X11
|
||||
%patch -p0 -b .config
|
||||
popd
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
|
||||
|
||||
%build
|
||||
# Xaw3d7
|
||||
@ -79,20 +78,24 @@ xmkmf
|
||||
make CDEBUGFLAGS="${RPM_OPT_FLAGS} -DARROW_SCROLLBAR"
|
||||
popd
|
||||
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
make install DESTDIR=$RPM_BUILD_ROOT SHLIBDIR=%{_libdir} INCDIR=%{_includedir} -C xc/lib/Xaw3d
|
||||
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
|
||||
%postun -p /sbin/ldconfig
|
||||
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc xc/lib/Xaw3d/README.XAW3D
|
||||
%{_libdir}/*.so.*
|
||||
|
||||
%files devel
|
||||
@ -101,6 +104,16 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_includedir}/X11/Xaw3d
|
||||
|
||||
%changelog
|
||||
* Tue Oct 6 2008 Hans de Goede <hdegoede@redhat.com> 1.5E-12
|
||||
- Remove obsolete PreReq and Prefix stuff from specfile
|
||||
- Fix BuildRoot to match the guidelines
|
||||
- Require base package by full EVR from devel package
|
||||
- Drop non relevant Patches and Sources
|
||||
- Rebase the still relevant patches
|
||||
- Actually apply the still relevant patches
|
||||
- Add a patch from Debian fixing an infinite loop (rh436998)
|
||||
- Add patches from Debian fixes various potential bufferoverflows
|
||||
|
||||
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.5E-11.1
|
||||
- Autorebuild for GCC 4.3
|
||||
|
||||
@ -259,7 +272,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
- translations modified for de, fr, tr
|
||||
|
||||
* Tue Nov 04 1997 Erik Troan <ewt@redhat.com>
|
||||
- don't lave an improper return code from %pre
|
||||
- don't lave an improper return code from %%pre
|
||||
|
||||
* Mon Nov 03 1997 Cristian Gafton <gafton@redhat.com>
|
||||
- take care of the old location of the Xaw3d includes in case that one exist
|
||||
|
||||
1
sources
1
sources
@ -1,2 +1 @@
|
||||
9eaac2b8cae978f3a740ebb6933b898e Xaw3d-1.3.tar.gz
|
||||
29ecfdcd6bcf47f62ecfd672d31269a1 Xaw3d-1.5E.tar.gz
|
||||
|
||||
22
xaw3d.patch
22
xaw3d.patch
@ -1,6 +1,7 @@
|
||||
--- Xaw3d-1.5/xc/lib/Xaw3d/Scrollbar.c Tue Oct 15 07:41:21 1996
|
||||
+++ Xaw3d-1.5.ia64/xc/lib/Xaw3d/Scrollbar.c Tue May 9 07:02:52 2000
|
||||
@@ -1178,7 +1178,11 @@
|
||||
diff -up Xaw3d-1.5E/xc/lib/Xaw3d/Scrollbar.c.orig Xaw3d-1.5E/xc/lib/Xaw3d/Scrollbar.c
|
||||
--- Xaw3d-1.5E/xc/lib/Xaw3d/Scrollbar.c.orig 2003-02-10 18:22:26.000000000 +0100
|
||||
+++ Xaw3d-1.5E/xc/lib/Xaw3d/Scrollbar.c 2008-10-06 10:07:46.000000000 +0200
|
||||
@@ -1087,7 +1087,11 @@ static void NotifyThumb (w, event, param
|
||||
Cardinal *num_params; /* unused */
|
||||
{
|
||||
register ScrollbarWidget sbw = (ScrollbarWidget) w;
|
||||
@ -11,20 +12,19 @@
|
||||
+ } foo;
|
||||
+ foo.top = sbw->scrollbar.top;
|
||||
|
||||
#ifndef ARROW_SCROLLBAR
|
||||
#ifndef XAW_ARROW_SCROLLBARS
|
||||
if (sbw->scrollbar.direction == 0) return; /* if no StartScroll */
|
||||
@@ -1204,10 +1208,10 @@
|
||||
there is no problem since in this case there is always a constant
|
||||
integer number of pixels the thumb must be moved in order to scroll
|
||||
to the next line/column. */
|
||||
@@ -1116,10 +1120,10 @@ static void NotifyThumb (w, event, param
|
||||
/* Removed the dependancy on scrollbar arrows. Xterm as distributed in
|
||||
X11R6.6 by The XFree86 Project wants this correction, with or without
|
||||
the arrows. */
|
||||
- top += 0.0001;
|
||||
+ foo.top += 0.0001;
|
||||
#endif
|
||||
/* #endif */
|
||||
- XtCallCallbacks (w, XtNthumbProc, *(XtPointer*)&top);
|
||||
- XtCallCallbacks (w, XtNjumpProc, (XtPointer)&top);
|
||||
+ XtCallCallbacks (w, XtNthumbProc, foo.pt);
|
||||
+ XtCallCallbacks (w, XtNjumpProc, (XtPointer)&sbw->scrollbar.top);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user