Your message dated Thu, 07 Jan 2021 19:34:22 +0000
with message-id <[email protected]>
and subject line Bug#670732: fixed in xaw3d 1.5+F-1
has caused the Debian Bug report #670732,
regarding [PATCH] xaw3d: Helping to update to packaging format 3.0
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
670732: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=670732
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: xaw3d
Severity: wishlist
Tags: patch

Hi,

The dpatch patch management system has been deprecated for some time. The
Lintian currently flags use of dpatch packages as an error. The new 3.0
packaging format is an improved version which, among other things, contains
patch management built-in. For more information, see:

    http://wiki.debian.org/Projects/DebSrc3.0

I had some free time; see attached patch to migrate to new package
format. Note that all files in debian/patches/* are canocalized to
*.patch.

Note:

    There were lot on in-line changes which were moved to patch 03.
    Original sources were restored.

Let me know if there is anything that needs adjusting or if it is ok
to upload this version in a NMU in case you are working on other
issues needing attention.

Thanks,
Jari

>From fc5bc1cb76933a4eb9e01c12d4de54ba8626aebe Mon Sep 17 00:00:00 2001
From: Jari Aalto <[email protected]>
Date: Sat, 28 Apr 2012 18:04:19 +0300
Subject: [PATCH] format-3.0
Organization: Private
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

Signed-off-by: Jari Aalto <[email protected]>
---
 Xdefault                                           |   17 -
 compat.im                                          |  248 ------
 debian/README.source                               |   17 -
 debian/changelog                                   |   17 +-
 debian/compat                                      |    2 +-
 debian/control                                     |    6 +-
 debian/patches/00list                              |    5 -
 debian/patches/03-local-changes.patch              |  881 ++++++++++++++++++++
 .../{Imakefile.dpatch => 05-Imakefile.patch}       |   21 +-
 .../patches/{SmeBSB.c.dpatch => 10-SmeBSB.c.patch} |   18 -
 debian/patches/{Box.c.dpatch => 15-Box.c.patch}    |    8 +-
 debian/patches/20-MultiSrc.c.patch                 |   17 +
 .../patches/{XawIm.c.dpatch => 25-XawIm.c.patch}   |    8 +-
 debian/patches/MultiSrc.c.dpatch                   |   18 -
 debian/patches/series                              |    6 +
 debian/postinst                                    |    4 +-
 debian/rules                                       |   12 +-
 debian/source/format                               |    1 +
 lib/Xaw3d/AsciiSrc.c                               |   42 +-
 lib/Xaw3d/AsciiSrcP.h                              |    6 +-
 lib/Xaw3d/MenuButton.c                             |   15 +-
 lib/Xaw3d/MultiSrc.c                               |   39 +-
 lib/Xaw3d/MultiSrcP.h                              |    6 +-
 lib/Xaw3d/Scrollbar.c                              |    1 -
 lib/Xaw3d/Simple.c                                 |   18 +-
 lib/Xaw3d/SimpleMenu.c                             |   16 +-
 lib/Xaw3d/StripChart.c                             |   10 +-
 lib/Xaw3d/Text.c                                   |   49 +-
 lib/Xaw3d/TextPop.c                                |   71 +-
 lib/Xaw3d/XawAlloc.h                               |   10 -
 lib/Xaw3d/XawI18n.h                                |    3 -
 31 files changed, 999 insertions(+), 593 deletions(-)
 delete mode 100644 Xdefault
 delete mode 100644 compat.im
 delete mode 100644 debian/README.source
 delete mode 100644 debian/patches/00list
 create mode 100644 debian/patches/03-local-changes.patch
 rename debian/patches/{Imakefile.dpatch => 05-Imakefile.patch} (62%)
 rename debian/patches/{SmeBSB.c.dpatch => 10-SmeBSB.c.patch} (84%)
 rename debian/patches/{Box.c.dpatch => 15-Box.c.patch} (78%)
 create mode 100644 debian/patches/20-MultiSrc.c.patch
 rename debian/patches/{XawIm.c.dpatch => 25-XawIm.c.patch} (77%)
 delete mode 100644 debian/patches/MultiSrc.c.dpatch
 create mode 100644 debian/patches/series
 mode change 100644 => 100755 debian/postinst
 create mode 100644 debian/source/format
 delete mode 100644 lib/Xaw3d/XawAlloc.h

diff --git a/Xdefault b/Xdefault
deleted file mode 100644
index 488be6f..0000000
--- a/Xdefault
+++ /dev/null
@@ -1,17 +0,0 @@
-!this is an example of a .Xdefaults file to be used with the Xaw3d
-!widget set.
-
-!  To obtain an appearance similar to another well known widget set, use the 
-!  following resources:
-*background:        LightSkyBlue
-*shapeStyle:        Rectangle
-*beNiceToColormap:  False
-
-!  By default, Label widgets do not have shadows drawn for them.  You can
-!  force shadows to be drawn for specifying:
-*Label*shadowWidth: 2
-
-!If you'd like the default behavior (i.e. not 3-D) on pulldown menus, use:
-! (uncomment next line:)
-!*SmeBSB*shadowWidth: 0
-
diff --git a/compat.im b/compat.im
deleted file mode 100644
index b8dce16..0000000
--- a/compat.im
+++ /dev/null
@@ -1,248 +0,0 @@
-XCOMM $XConsortium: Imakefile,v 1.78 91/09/18 14:28:23 rws Exp $
-
-#define DoSharedLib SharedLibXaw
-#define DoDebugLib DebugLibXaw 
-#define DoProfileLib ProfileLibXaw 
-#define HasSharedData YES
-#define LibName Xaw3d
-#define SoRev SOXAWREV
-#define IncSubdir Xaw3d
-
-#ifdef LinuxArchitecture
-#JUMP_ROOT_Xaw3d = $(AWIDGETSRC)3d
-#JUMP_IS_HOST_Xaw3d = YES
-#JUMP_STUBLIBS_Xaw3d = libXaw3d.sa
-#JUMP_SUBDIRS_Xaw3d = $(JUMP_ROOT_Xt)
-#JUMP_DIR_Xaw3d = $(JUMP_ROOT_Xaw3d)/shared
-#JUMP_VARS_Xaw3d = $(JUMP_ROOT_Xaw3d)/jump_vars
-#JUMP_FUNCS_Xaw3d = $(JUMP_ROOT_Xaw3d)/jump_funcs
-#JUMP_IGNORE_Xaw3d = $(JUMP_ROOT_Xaw3d)/jump_ignore
-#JUMP_EXPORT_Xaw3d = $(JUMP_DIR_Xaw3d)/jump.vars
-#JUMP_IMPORT_Xaw3d = $(JUMP_EXPORT_Xt) $(JUMP_EXPORT_X11)
-#JUMP_ADDRESS_Xaw3d = 0x60300000
-#JUMP_JUMPTABLESIZE_Xaw3d = 0x4000
-#JUMP_GOTSIZE_Xaw3d = 4096
-#JUMP_STUBNAMES_Xaw3d = libXaw3d
-#JUMP_STUBS_IMPORT_Xaw3d = $(JUMP_STUBS_IMPORT_X11)
-#JUMP_LDLIBS_Xaw3d = $(JUMP_ROOT_Xt)/libXt.sa $(JUMP_ROOT_Xt)/libXmu.sa \
-#        $(JUMP_ROOT_Xt)/libXext.sa $(JUMP_ROOT_X11)/libX11.sa \
-#        $(JUMP_LDLIBS_libc)
-#endif
-
-#ifdef SharedXawReqs
-REQUIREDLIBS = SharedXawReqs
-#endif
-
-DEFINES = XawI18nDefines
-
-       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()
-
diff --git a/debian/README.source b/debian/README.source
deleted file mode 100644
index 34b8112..0000000
--- a/debian/README.source
+++ /dev/null
@@ -1,17 +0,0 @@
-This package uses dpatch to manage all modifications to the upstream
-source.  Changes are storged in the source package as diffs with
-special dpatch headers in debian/patches.  The file debian/patches/00list
-determines which dpatch diffs are applied in which order during the build.
-
-To add a new or modify an existing diff, use the tool dpatch-edit-patch,
-provided in package dpatch. Use the name of the diff without suffix .dpatch
-as the first argument to dpatch-edit-patch. It will prepare a copy of the
-source tree ready for editing in a new shell. Upon exit, all modifications
-will be represented in the dpatch diff.
-
-Optionally, if the name of an existing diff (without suffix .dpatch) is given
-as the second argument, the editable copy of the source tree will be patched
-with all dpatches up to and including the specified diff.
-
-* Note that the original author has passed away a few years ago, so the library
-is essentially unmaintained properly since then *
diff --git a/debian/changelog b/debian/changelog
index 26d66ea..120488e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+xaw3d (1.5+E-18.2) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Remove deprecated dpatch and upgrade to packaging format "3.0 quilt".
+  * Update to Standards-Version to 3.9.3 and debhelper to 9.
+  * Add required build-arch and build-indep targets to rules file.
+  * Patches:
+    - Number all files
+    - 03 is new; in-line changes to original sources.
+  * Fix maintainer-script-without-set-e postinst (Lintian).
+
+ -- Jari Aalto <[email protected]>  Sat, 28 Apr 2012 17:56:42 +0300
+
 xaw3d (1.5+E-18.1) unstable; urgency=medium
 
   * Non-maintainer upload.
@@ -566,7 +579,3 @@ xaw3d (1.3-1) unstable; urgency=low
   * Converted to new source scheme.
 
  -- joost witteveen <[email protected]>  Sun, 8 Dec 1996 10:58:02 +0100
-
-Local variables:
-mode: debian-changelog
-End:
diff --git a/debian/compat b/debian/compat
index 7f8f011..ec63514 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-7
+9
diff --git a/debian/control b/debian/control
index 3b7e7ca..3a3217f 100644
--- a/debian/control
+++ b/debian/control
@@ -2,9 +2,9 @@ Source: xaw3d
 Section: x11
 Priority: optional
 Maintainer: Francesco Paolo Lovergine <[email protected]>
-Build-Depends: debhelper (>= 7), xutils-dev (>= 1:1.0.2-3), libx11-dev, libxmu-dev, libxpm-dev, libxt-dev, x11proto-core-dev, x11proto-xext-dev, 
- bison, flex-old|flex (>= 2.5.31-16), dpatch
-Standards-Version: 3.8.4
+Build-Depends: debhelper (>= 9), xutils-dev (>= 1:1.0.2-3), libx11-dev, libxmu-dev, libxpm-dev, libxt-dev, x11proto-core-dev, x11proto-xext-dev, 
+ bison, flex-old|flex (>= 2.5.31-16)
+Standards-Version: 3.9.3
 
 Package: xaw3dg
 Architecture: any
diff --git a/debian/patches/00list b/debian/patches/00list
deleted file mode 100644
index 342c09a..0000000
--- a/debian/patches/00list
+++ /dev/null
@@ -1,5 +0,0 @@
-Imakefile
-SmeBSB.c
-Box.c
-MultiSrc.c
-XawIm.c
diff --git a/debian/patches/03-local-changes.patch b/debian/patches/03-local-changes.patch
new file mode 100644
index 0000000..39049ba
--- /dev/null
+++ b/debian/patches/03-local-changes.patch
@@ -0,0 +1,881 @@
+diff --git a/Xdefault b/Xdefault
+new file mode 100644
+index 0000000..488be6f
+--- /dev/null
++++ b/Xdefault
+@@ -0,0 +1,17 @@
++!this is an example of a .Xdefaults file to be used with the Xaw3d
++!widget set.
++
++!  To obtain an appearance similar to another well known widget set, use the 
++!  following resources:
++*background:        LightSkyBlue
++*shapeStyle:        Rectangle
++*beNiceToColormap:  False
++
++!  By default, Label widgets do not have shadows drawn for them.  You can
++!  force shadows to be drawn for specifying:
++*Label*shadowWidth: 2
++
++!If you'd like the default behavior (i.e. not 3-D) on pulldown menus, use:
++! (uncomment next line:)
++!*SmeBSB*shadowWidth: 0
++
+diff --git a/compat.im b/compat.im
+new file mode 100644
+index 0000000..b8dce16
+--- /dev/null
++++ b/compat.im
+@@ -0,0 +1,248 @@
++XCOMM $XConsortium: Imakefile,v 1.78 91/09/18 14:28:23 rws Exp $
++
++#define DoSharedLib SharedLibXaw
++#define DoDebugLib DebugLibXaw 
++#define DoProfileLib ProfileLibXaw 
++#define HasSharedData YES
++#define LibName Xaw3d
++#define SoRev SOXAWREV
++#define IncSubdir Xaw3d
++
++#ifdef LinuxArchitecture
++#JUMP_ROOT_Xaw3d = $(AWIDGETSRC)3d
++#JUMP_IS_HOST_Xaw3d = YES
++#JUMP_STUBLIBS_Xaw3d = libXaw3d.sa
++#JUMP_SUBDIRS_Xaw3d = $(JUMP_ROOT_Xt)
++#JUMP_DIR_Xaw3d = $(JUMP_ROOT_Xaw3d)/shared
++#JUMP_VARS_Xaw3d = $(JUMP_ROOT_Xaw3d)/jump_vars
++#JUMP_FUNCS_Xaw3d = $(JUMP_ROOT_Xaw3d)/jump_funcs
++#JUMP_IGNORE_Xaw3d = $(JUMP_ROOT_Xaw3d)/jump_ignore
++#JUMP_EXPORT_Xaw3d = $(JUMP_DIR_Xaw3d)/jump.vars
++#JUMP_IMPORT_Xaw3d = $(JUMP_EXPORT_Xt) $(JUMP_EXPORT_X11)
++#JUMP_ADDRESS_Xaw3d = 0x60300000
++#JUMP_JUMPTABLESIZE_Xaw3d = 0x4000
++#JUMP_GOTSIZE_Xaw3d = 4096
++#JUMP_STUBNAMES_Xaw3d = libXaw3d
++#JUMP_STUBS_IMPORT_Xaw3d = $(JUMP_STUBS_IMPORT_X11)
++#JUMP_LDLIBS_Xaw3d = $(JUMP_ROOT_Xt)/libXt.sa $(JUMP_ROOT_Xt)/libXmu.sa \
++#        $(JUMP_ROOT_Xt)/libXext.sa $(JUMP_ROOT_X11)/libX11.sa \
++#        $(JUMP_LDLIBS_libc)
++#endif
++
++#ifdef SharedXawReqs
++REQUIREDLIBS = SharedXawReqs
++#endif
++
++DEFINES = XawI18nDefines
++
++       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()
++
+diff --git a/lib/Xaw3d/AsciiSrc.c b/lib/Xaw3d/AsciiSrc.c
+index be8cdf8..61de46d 100644
+--- a/lib/Xaw3d/AsciiSrc.c
++++ b/lib/Xaw3d/AsciiSrc.c
+@@ -51,11 +51,17 @@ in this Software without prior written authorization from the X Consortium.
+ #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 --git a/lib/Xaw3d/AsciiSrcP.h b/lib/Xaw3d/AsciiSrcP.h
+index dcb33ff..30ba992 100644
+--- a/lib/Xaw3d/AsciiSrcP.h
++++ b/lib/Xaw3d/AsciiSrcP.h
+@@ -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 --git a/lib/Xaw3d/MenuButton.c b/lib/Xaw3d/MenuButton.c
+index b96a027..493ff76 100644
+--- a/lib/Xaw3d/MenuButton.c
++++ b/lib/Xaw3d/MenuButton.c
+@@ -53,6 +53,8 @@ in this Software without prior written authorization from the X Consortium.
+ #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 --git a/lib/Xaw3d/MultiSrc.c b/lib/Xaw3d/MultiSrc.c
+index 05a6530..e420806 100644
+--- a/lib/Xaw3d/MultiSrc.c
++++ b/lib/Xaw3d/MultiSrc.c
+@@ -74,6 +74,9 @@ in this Software without prior written authorization from the X Consortium.
+ #include <stdio.h>
+ #include <ctype.h>
+ #include <errno.h>
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <fcntl.h>
+ 
+ /****************************************************************
+  *
+@@ -1076,7 +1079,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);
+@@ -1127,7 +1132,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:
+@@ -1140,9 +1146,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",
+@@ -1161,11 +1175,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;
+ 	    
+@@ -1177,7 +1194,7 @@ InitStringOrFile(src, newString)
+ 	}
+     } 
+     src->multi_src.length = 0;
+-    return((FILE *)NULL);
++    return(NULL);
+ #undef StrLen
+ }
+ 
+diff --git a/lib/Xaw3d/MultiSrcP.h b/lib/Xaw3d/MultiSrcP.h
+index 6996361..9c98a1d 100644
+--- a/lib/Xaw3d/MultiSrcP.h
++++ b/lib/Xaw3d/MultiSrcP.h
+@@ -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 --git a/lib/Xaw3d/Scrollbar.c b/lib/Xaw3d/Scrollbar.c
+index c105688..12f4159 100644
+--- a/lib/Xaw3d/Scrollbar.c
++++ b/lib/Xaw3d/Scrollbar.c
+@@ -1049,6 +1049,7 @@ static void MoveThumb (w, event, params, num_params)
+     if (!event->xmotion.same_screen) return;
+ 
+     ExtractPosition (event, &x, &y);
++    
+     loc = FractionLoc (sbw, x, y);
+     t = sbw->scrollbar.top;
+     s = sbw->scrollbar.shown;
+diff --git a/lib/Xaw3d/Simple.c b/lib/Xaw3d/Simple.c
+index 29cbbc8..8051030 100644
+--- a/lib/Xaw3d/Simple.c
++++ b/lib/Xaw3d/Simple.c
+@@ -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 --git a/lib/Xaw3d/SimpleMenu.c b/lib/Xaw3d/SimpleMenu.c
+index 87a3170..2bf439d 100644
+--- a/lib/Xaw3d/SimpleMenu.c
++++ b/lib/Xaw3d/SimpleMenu.c
+@@ -51,6 +51,8 @@ in this Software without prior written authorization from the X Consortium.
+ #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 --git a/lib/Xaw3d/StripChart.c b/lib/Xaw3d/StripChart.c
+index 5344f97..2a8ad46 100644
+--- a/lib/Xaw3d/StripChart.c
++++ b/lib/Xaw3d/StripChart.c
+@@ -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 --git a/lib/Xaw3d/Text.c b/lib/Xaw3d/Text.c
+index 4b47bbd..fcc12ce 100644
+--- a/lib/Xaw3d/Text.c
++++ b/lib/Xaw3d/Text.c
+@@ -75,6 +75,8 @@ SOFTWARE.
+ #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
+@@ -520,6 +522,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,
+@@ -568,10 +572,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)
+@@ -579,18 +590,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 --git a/lib/Xaw3d/TextPop.c b/lib/Xaw3d/TextPop.c
+index 260b4dc..cf01b4f 100644
+--- a/lib/Xaw3d/TextPop.c
++++ b/lib/Xaw3d/TextPop.c
+@@ -66,6 +66,8 @@ in this Software without prior written authorization from the X Consortium.
+ #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 --git a/lib/Xaw3d/XawAlloc.h b/lib/Xaw3d/XawAlloc.h
+new file mode 100644
+index 0000000..ed0fe90
+--- /dev/null
++++ b/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
++
+diff --git a/lib/Xaw3d/XawI18n.h b/lib/Xaw3d/XawI18n.h
+index 1b0ee5d..a0e4d18 100644
+--- a/lib/Xaw3d/XawI18n.h
++++ b/lib/Xaw3d/XawI18n.h
+@@ -27,6 +27,8 @@ in this Software without prior written authorization from the X Consortium.
+ 
+ ********************************************************/
+ 
++/* Mod for Debian by Joey Hess, do not include widec.h */
++#if 0
+ #ifdef HAS_WCTYPE_H
+ #include <wctype.h>
+ #include <widec.h>
+@@ -34,6 +36,7 @@ in this Software without prior written authorization from the X Consortium.
+ #define wcscpy(d,s) wscpy(d,s)
+ #define wcsncpy(d,s,l) wsncpy(d,s,l)
+ #endif
++#endif /* 0 */
+ 
+ #ifdef HAS_WCHAR_H
+ #include <wchar.h>
diff --git a/debian/patches/Imakefile.dpatch b/debian/patches/05-Imakefile.patch
similarity index 62%
rename from debian/patches/Imakefile.dpatch
rename to debian/patches/05-Imakefile.patch
index 860a499..0d52bfe 100644
--- a/debian/patches/Imakefile.dpatch
+++ b/debian/patches/05-Imakefile.patch
@@ -1,21 +1,6 @@
-#!/bin/sh -e
-[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
-                                                                                                                
-if [ $# -ne 1 ]; then
-echo >&2 "bash: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-case "$1" in
-       -patch) patch $patch_opts -p1 < $0;;
-       -unpatch) patch $patch_opts -p1 -R < $0;;
-        *)
-                echo >&2 "bash: script expects -patch|-unpatch as argument"
-                exit 1;;
-esac
-                                                                                                                
-exit 0
-@DPATCH@
+From: Unknown
+Subject: Makefile fixes
+
 diff -urNad /home/frankie/debian/mypkgs/xaw3d/xaw3d-1.5+E/lib/Xaw3d/Imakefile xaw3d-1.5+E/lib/Xaw3d/Imakefile
 --- /home/frankie/debian/mypkgs/xaw3d/xaw3d-1.5+E/lib/Xaw3d/Imakefile	2003-08-28 20:28:32.000000000 +0200
 +++ xaw3d-1.5+E/lib/Xaw3d/Imakefile	2003-08-28 20:37:21.000000000 +0200
diff --git a/debian/patches/SmeBSB.c.dpatch b/debian/patches/10-SmeBSB.c.patch
similarity index 84%
rename from debian/patches/SmeBSB.c.dpatch
rename to debian/patches/10-SmeBSB.c.patch
index b00c667..70aa19e 100644
--- a/debian/patches/SmeBSB.c.dpatch
+++ b/debian/patches/10-SmeBSB.c.patch
@@ -1,21 +1,3 @@
-#!/bin/sh -e
-[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
-                                                                                                                
-if [ $# -ne 1 ]; then
-echo >&2 "bash: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-case "$1" in
-       -patch) patch $patch_opts -p1 < $0;;
-       -unpatch) patch $patch_opts -p1 -R < $0;;
-        *)
-                echo >&2 "bash: script expects -patch|-unpatch as argument"
-                exit 1;;
-esac
-                                                                                                                
-exit 0
-@DPATCH@
 diff -urNad /home/frankie/debian/mypkgs/xaw3d/xaw3d-1.5e/lib/Xaw3d/SmeBSB.c xaw3d-1.5e/lib/Xaw3d/SmeBSB.c
 --- /home/frankie/debian/mypkgs/xaw3d/xaw3d-1.5e/lib/Xaw3d/SmeBSB.c	2003-08-04 17:27:58.000000000 +0200
 +++ xaw3d-1.5e/lib/Xaw3d/SmeBSB.c	2003-08-07 15:02:39.000000000 +0200
diff --git a/debian/patches/Box.c.dpatch b/debian/patches/15-Box.c.patch
similarity index 78%
rename from debian/patches/Box.c.dpatch
rename to debian/patches/15-Box.c.patch
index db00293..6ff8de3 100644
--- a/debian/patches/Box.c.dpatch
+++ b/debian/patches/15-Box.c.patch
@@ -1,10 +1,6 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## box.c.dpatch by Francesco Paolo Lovergine <[email protected]>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: No description.
+From: Francesco Paolo Lovergine <[email protected]>
+Subject: avoid short int overflow
 
-@DPATCH@
 diff -urNad xaw3d-1.5+E~/lib/Xaw3d/Box.c xaw3d-1.5+E/lib/Xaw3d/Box.c
 --- xaw3d-1.5+E~/lib/Xaw3d/Box.c	1996-10-15 16:41:18.000000000 +0200
 +++ xaw3d-1.5+E/lib/Xaw3d/Box.c	2007-04-24 15:28:39.000000000 +0200
diff --git a/debian/patches/20-MultiSrc.c.patch b/debian/patches/20-MultiSrc.c.patch
new file mode 100644
index 0000000..0934f66
--- /dev/null
+++ b/debian/patches/20-MultiSrc.c.patch
@@ -0,0 +1,17 @@
+From: Francesco Paolo Lovergine <[email protected]>
+Subject: No description.
+
+---
+ lib/Xaw3d/MultiSrc.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/lib/Xaw3d/MultiSrc.c
++++ b/lib/Xaw3d/MultiSrc.c
+@@ -736,6 +736,7 @@
+   
+   if ( string_set || (old_src->multi_src.type != src->multi_src.type) ) {
+     RemoveOldStringOrFile(old_src, string_set);
++    src->multi_src.allocated_string = old_src->multi_src.allocated_string;
+     file = InitStringOrFile(src, string_set);
+ 
+     /* Load pieces does this logic for us, but it shouldn't.  Its messy.*/
diff --git a/debian/patches/XawIm.c.dpatch b/debian/patches/25-XawIm.c.patch
similarity index 77%
rename from debian/patches/XawIm.c.dpatch
rename to debian/patches/25-XawIm.c.patch
index 4d8e97c..fbcbb7e 100644
--- a/debian/patches/XawIm.c.dpatch
+++ b/debian/patches/25-XawIm.c.patch
@@ -1,10 +1,6 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## XawIm.c.dpatch by Francesco Paolo Lovergine <[email protected]>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: No description.
+From: Francesco Paolo Lovergine <[email protected]>
+Subject: Correct location of CloseIM()
 
-@DPATCH@
 diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' xaw3d-1.5+E~/lib/Xaw3d/XawIm.c xaw3d-1.5+E/lib/Xaw3d/XawIm.c
 --- xaw3d-1.5+E~/lib/Xaw3d/XawIm.c	1998-04-21 15:42:02.000000000 +0200
 +++ xaw3d-1.5+E/lib/Xaw3d/XawIm.c	2010-04-26 17:18:24.000000000 +0200
diff --git a/debian/patches/MultiSrc.c.dpatch b/debian/patches/MultiSrc.c.dpatch
deleted file mode 100644
index 05b7481..0000000
--- a/debian/patches/MultiSrc.c.dpatch
+++ /dev/null
@@ -1,18 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## MultiSrc.c.dpatch by Francesco Paolo Lovergine <[email protected]>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: No description.
-
-@DPATCH@
-diff -urNad xaw3d-1.5+E~/lib/Xaw3d/MultiSrc.c xaw3d-1.5+E/lib/Xaw3d/MultiSrc.c
---- xaw3d-1.5+E~/lib/Xaw3d/MultiSrc.c	2006-01-09 08:30:52.000000000 +0100
-+++ xaw3d-1.5+E/lib/Xaw3d/MultiSrc.c	2008-07-24 11:16:52.000000000 +0200
-@@ -739,6 +739,7 @@
-   
-   if ( string_set || (old_src->multi_src.type != src->multi_src.type) ) {
-     RemoveOldStringOrFile(old_src, string_set);
-+    src->multi_src.allocated_string = old_src->multi_src.allocated_string;
-     file = InitStringOrFile(src, string_set);
- 
-     /* Load pieces does this logic for us, but it shouldn't.  Its messy.*/
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..35e6893
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,6 @@
+03-local-changes.patch
+05-Imakefile.patch
+10-SmeBSB.c.patch
+15-Box.c.patch
+20-MultiSrc.c.patch
+25-XawIm.c.patch
diff --git a/debian/postinst b/debian/postinst
old mode 100644
new mode 100755
index 58e2f7a..b2c4bb3
--- a/debian/postinst
+++ b/debian/postinst
@@ -1,4 +1,6 @@
-#!/bin/sh -e
+#!/bin/sh
+
+set -e
 
 case "$1" in
         configure)
diff --git a/debian/rules b/debian/rules
index 5fdf7d3..4c50091 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,7 +5,6 @@ PACKAGE = xaw3d
 
 #export DH_VERBOSE = 1
 
-include /usr/share/dpatch/dpatch.make
 
 ifneq (,$(findstring $(ARCH), $(COMPATARCHS)))
 #
@@ -20,19 +19,24 @@ endif
 
 SOURCE=lib/Xaw3d
 
+
+build-arch: build
+build-indep: build
+
 build: stamp-build
-stamp-build: patch-stamp
+stamp-build:
 	rm -rf $(SOURCE)/X11 && install -m755 -d $(SOURCE)/X11
 	cd $(SOURCE) && ln -sf ../ X11/Xaw3d && xmkmf
 	$(MAKE) -C $(SOURCE) \
           EXTRA_DEFINES="-D_REENTRANT -DARROW_SCROLLBAR" SHLIBDEF="-D_REENTRANT -DARROW_SCROLLBAR"
 	touch $@
 
-clean: myclean unpatch
+clean: myclean
 myclean:
 	rm -rf $(SOURCE)/X11 $(COMPAT) lib/Xaw3d/laygram.h
 	cd $(SOURCE) && [ -f $(SOURCE)/Makefile ] || xmkmf
 	$(MAKE) -C $(SOURCE) clean
+	rm -rf lib/Xaw3d/*.so*
 	dh_clean stamp-build `find . -name Makefile`
 
 install: DH_OPTIONS=
@@ -66,4 +70,4 @@ binary-arch: install
 	dh_md5sums
 	dh_builddeb
 
-.PHONY:	build clean install binary binary-arch binary-indep unpatch myclean patch
+.PHONY:	build clean install binary binary-arch binary-indep myclean
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/lib/Xaw3d/AsciiSrc.c b/lib/Xaw3d/AsciiSrc.c
index 61de46d..be8cdf8 100644
--- a/lib/Xaw3d/AsciiSrc.c
+++ b/lib/Xaw3d/AsciiSrc.c
@@ -51,17 +51,11 @@ in this Software without prior written authorization from the X Consortium.
 #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>
 
 /****************************************************************
  *
@@ -1013,9 +1007,7 @@ InitStringOrFile(src, newString)
 AsciiSrcObject src;
 Boolean newString;
 {
-    mode_t open_mode = 0;
-    const char *fdopen_mode = NULL;
-    int fd;
+    char * open_mode = NULL;
     FILE * file;
     char fileName[TMPSIZ];
 
@@ -1057,8 +1049,7 @@ Boolean newString;
 	    XtErrorMsg("NoFile", "asciiSourceCreate", "XawError",
 		     "Creating a read only disk widget and no file specified.",
 		       NULL, 0);
-	open_mode = O_RDONLY;
-	fdopen_mode = "r";
+	open_mode = "r";
 	break;
     case XawtextAppend:
     case XawtextEdit:
@@ -1066,17 +1057,9 @@ Boolean newString;
 	    src->ascii_src.string = fileName;
 	    (void) tmpnam(src->ascii_src.string);
 	    src->ascii_src.is_tempfile = TRUE;
-	    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+";
-	}
+	    open_mode = "w";
+	} else
+	    open_mode = "r+";
 	break;
     default:
 	XtErrorMsg("badMode", "asciiSourceCreate", "XawError",
@@ -1095,14 +1078,11 @@ Boolean newString;
     }
     
     if (!src->ascii_src.is_tempfile) {
-	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);
-	    }
-	}
-	{	    
+	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 {
 	    String params[2];
 	    Cardinal num_params = 2;
 	    
@@ -1114,7 +1094,7 @@ Boolean newString;
 	}
     } 
     src->ascii_src.length = 0;
-    return(NULL);
+    return((FILE *)NULL);
 }
 
 static void
diff --git a/lib/Xaw3d/AsciiSrcP.h b/lib/Xaw3d/AsciiSrcP.h
index 30ba992..dcb33ff 100644
--- a/lib/Xaw3d/AsciiSrcP.h
+++ b/lib/Xaw3d/AsciiSrcP.h
@@ -85,11 +85,7 @@ SOFTWARE.
 #ifdef L_tmpnam
 #define TMPSIZ L_tmpnam
 #else
-#ifdef PATH_MAX
-#define TMPSIZ PATH_MAX
-#else
-#define TMPSIZ 1024		/* bytes to allocate for tmpnam */
-#endif
+#define TMPSIZ 32		/* bytes to allocate for tmpnam */
 #endif
 
 #define MAGIC_VALUE ((XawTextPosition) -1) /* Magic value. */
diff --git a/lib/Xaw3d/MenuButton.c b/lib/Xaw3d/MenuButton.c
index 493ff76..b96a027 100644
--- a/lib/Xaw3d/MenuButton.c
+++ b/lib/Xaw3d/MenuButton.c
@@ -53,8 +53,6 @@ in this Software without prior written authorization from the X Consortium.
 #include <X11/Xaw3d/XawInit.h>
 #include <X11/Xaw3d/MenuButtoP.h>
 
-#include "XawAlloc.h"
-
 static void ClassInitialize();
 static void PopupMenu();
 
@@ -181,16 +179,9 @@ Cardinal * num_params;
 
   if (menu == NULL) {
     char error_buf[BUFSIZ];
-    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);
+    (void) sprintf(error_buf, "MenuButton: %s %s.",
+	    "Could not find menu widget named", mbw->menu_button.menu_name);
+    XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
     return;
   }
   if (!XtIsRealized(menu))
diff --git a/lib/Xaw3d/MultiSrc.c b/lib/Xaw3d/MultiSrc.c
index e420806..05a6530 100644
--- a/lib/Xaw3d/MultiSrc.c
+++ b/lib/Xaw3d/MultiSrc.c
@@ -74,9 +74,6 @@ in this Software without prior written authorization from the X Consortium.
 #include <stdio.h>
 #include <ctype.h>
 #include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
 
 /****************************************************************
  *
@@ -1079,9 +1076,7 @@ InitStringOrFile(src, newString)
     MultiSrcObject src;
     Boolean newString;
 {
-    mode_t open_mode = 0;
-    const char *fdopen_mode = NULL;
-    int fd;
+    char * open_mode = NULL;
     FILE * file;
     char fileName[TMPSIZ];
     Display *d = XtDisplayOfObject((Widget)src);
@@ -1132,8 +1127,7 @@ InitStringOrFile(src, newString)
 	    XtErrorMsg("NoFile", "multiSourceCreate", "XawError",
 		     "Creating a read only disk widget and no file specified.",
 		       NULL, 0);
-	open_mode = O_RDONLY;
-	fdopen_mode = "r";
+	open_mode = "r";
 	break;
     case XawtextAppend:
     case XawtextEdit:
@@ -1146,17 +1140,9 @@ InitStringOrFile(src, newString)
 
 	    (void) tmpnam(src->multi_src.string);
 	    src->multi_src.is_tempfile = TRUE;
-	    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+";
-	}
+	    open_mode = "w";
+	} else
+	    open_mode = "r+";
 	break;
     default:
 	XtErrorMsg("badMode", "multiSourceCreate", "XawError",
@@ -1175,14 +1161,11 @@ InitStringOrFile(src, newString)
     }
     
     if (!src->multi_src.is_tempfile) {
-	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);
-		}
-	}
-	{
+	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 {
 	    String params[2];
 	    Cardinal num_params = 2;
 	    
@@ -1194,7 +1177,7 @@ InitStringOrFile(src, newString)
 	}
     } 
     src->multi_src.length = 0;
-    return(NULL);
+    return((FILE *)NULL);
 #undef StrLen
 }
 
diff --git a/lib/Xaw3d/MultiSrcP.h b/lib/Xaw3d/MultiSrcP.h
index 9c98a1d..6996361 100644
--- a/lib/Xaw3d/MultiSrcP.h
+++ b/lib/Xaw3d/MultiSrcP.h
@@ -113,11 +113,7 @@ SOFTWARE.
 #ifdef L_tmpnam
 #define TMPSIZ L_tmpnam
 #else
-#ifdef PATH_MAX
-#define TMPSIZ PATH_MAX
-#else
-#define TMPSIZ 1024		/* bytes to allocate for tmpnam */
-#endif
+#define TMPSIZ 32		/* bytes to allocate for tmpnam */
 #endif
 
 #define MAGIC_VALUE ((XawTextPosition) -1) /* Magic value. */
diff --git a/lib/Xaw3d/Scrollbar.c b/lib/Xaw3d/Scrollbar.c
index 12f4159..c105688 100644
--- a/lib/Xaw3d/Scrollbar.c
+++ b/lib/Xaw3d/Scrollbar.c
@@ -1049,7 +1049,6 @@ static void MoveThumb (w, event, params, num_params)
     if (!event->xmotion.same_screen) return;
 
     ExtractPosition (event, &x, &y);
-    
     loc = FractionLoc (sbw, x, y);
     t = sbw->scrollbar.top;
     s = sbw->scrollbar.shown;
diff --git a/lib/Xaw3d/Simple.c b/lib/Xaw3d/Simple.c
index 8051030..29cbbc8 100644
--- a/lib/Xaw3d/Simple.c
+++ b/lib/Xaw3d/Simple.c
@@ -56,8 +56,6 @@ SOFTWARE.
 #include <X11/Xaw3d/SimpleP.h>
 #include <X11/Xmu/Drawing.h>
 
-#include "XawAlloc.h"
-
 #define offset(field) XtOffsetOf(SimpleRec, simple.field)
 
 static XtResource resources[] = {
@@ -150,17 +148,11 @@ static void ClassPartInitialize(class)
 
     if (c->simple_class.change_sensitive == NULL) {
 	char buf[BUFSIZ];
-	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);
-	}
+
+	(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);
 	c->simple_class.change_sensitive = ChangeSensitive;
     }
 
diff --git a/lib/Xaw3d/SimpleMenu.c b/lib/Xaw3d/SimpleMenu.c
index 2bf439d..87a3170 100644
--- a/lib/Xaw3d/SimpleMenu.c
+++ b/lib/Xaw3d/SimpleMenu.c
@@ -51,8 +51,6 @@ in this Software without prior written authorization from the X Consortium.
 #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)
@@ -757,17 +755,9 @@ Cardinal * num_params;
 
   if ( (menu = FindMenu(w, params[0])) == NULL) {
     char error_buf[BUFSIZ];
-    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);
+    (void) sprintf(error_buf, "%s '%s'",
+	    "Xaw - SimpleMenuWidget: could not find menu named: ", params[0]);
+    XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
     return;
   }
   
diff --git a/lib/Xaw3d/StripChart.c b/lib/Xaw3d/StripChart.c
index 2a8ad46..5344f97 100644
--- a/lib/Xaw3d/StripChart.c
+++ b/lib/Xaw3d/StripChart.c
@@ -315,15 +315,7 @@ 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,
-		/*
-		 * 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, 
+		       w->strip_chart.points, w->strip_chart.scale,
 		       CoordModePrevious);
        }
 
diff --git a/lib/Xaw3d/Text.c b/lib/Xaw3d/Text.c
index fcc12ce..4b47bbd 100644
--- a/lib/Xaw3d/Text.c
+++ b/lib/Xaw3d/Text.c
@@ -75,8 +75,6 @@ SOFTWARE.
 #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
@@ -522,8 +520,6 @@ 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,
@@ -572,17 +568,10 @@ Cardinal *num_args;		/* unused */
   if (ctx->text.scroll_vert != XawtextScrollNever) 
     if ( (ctx->text.resize == XawtextResizeHeight) ||
      	 (ctx->text.resize == XawtextResizeBoth) ) {
-      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);
-      }
+      (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);
       ctx->text.scroll_vert = XawtextScrollNever;
     }
     else if (ctx->text.scroll_vert == XawtextScrollAlways)
@@ -590,32 +579,18 @@ Cardinal *num_args;		/* unused */
 
   if (ctx->text.scroll_horiz != XawtextScrollNever) 
     if (ctx->text.wrap != XawtextWrapNever) {
-      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);
-      }
+      (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);
       ctx->text.scroll_horiz = XawtextScrollNever;
     }
     else if ( (ctx->text.resize == XawtextResizeWidth) ||
 	      (ctx->text.resize == XawtextResizeBoth) ) {
-      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);
-      }
+      (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);
       ctx->text.scroll_horiz = XawtextScrollNever;
     }
     else if (ctx->text.scroll_horiz == XawtextScrollAlways)
diff --git a/lib/Xaw3d/TextPop.c b/lib/Xaw3d/TextPop.c
index cf01b4f..260b4dc 100644
--- a/lib/Xaw3d/TextPop.c
+++ b/lib/Xaw3d/TextPop.c
@@ -66,8 +66,6 @@ in this Software without prior written authorization from the X Consortium.
 #include <X11/Xos.h>		/* for O_RDONLY */
 #include <errno.h>
 
-#include "XawAlloc.h"
-
 #ifdef X_NOT_STDC_ENV
 extern int errno;
 #endif
@@ -811,8 +809,6 @@ DoSearch(search)
 struct SearchAndReplace * search;
 {
   char msg[BUFSIZ];
-  char *pmsg;
-  int len;
   Widget tw = XtParent(search->search_popup);
   XawTextPosition pos;
   XawTextScanDirection dir;
@@ -839,20 +835,9 @@ 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) {
-    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 (pos == XawTextSearchError) 
+    (void) sprintf( msg, "Could not find string ``%s''.", GetString( search->search_text ) );
+  else {
     if (dir == XawsdRight)
       XawTextSetInsertionPoint( tw, pos + text.length);
     else
@@ -864,8 +849,7 @@ struct SearchAndReplace * search;
   }
   
   XawTextUnsetSelection(tw);
-  SetSearchLabels(search, pmsg, "", TRUE);
-  XtStackFree(pmsg, msg);
+  SetSearchLabels(search, msg, "", TRUE);
   return(FALSE);
 }
 
@@ -998,26 +982,13 @@ 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.*/
 
-	  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);
+	  (void) sprintf( msg, "%s %s %s", "*** Error: Could not find string ``",
+		  GetString( search->search_text ), "''. ***");
+	  SetSearchLabels(search, msg, "", TRUE);
 	  return(FALSE);
 	}
 	else
@@ -1040,22 +1011,9 @@ Boolean once_only, show_current;
 
     if (XawTextReplace(tw, pos, end_pos, &replace) != XawEditDone) {
       char msg[BUFSIZ];
-      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 ***");
-      }
+      
+      (void) sprintf( msg, "'%s' with '%s'. ***", find.ptr, replace.ptr);
       SetSearchLabels(search, "*** Error while replacing", msg, TRUE);
-      XtStackFree(pmsg, msg);
       return(FALSE);
     }      
 
@@ -1206,20 +1164,13 @@ XtArgVal value;
 {
   Widget temp_widget;
   char buf[BUFSIZ];
-  char *pbuf;
-  int len;
 
-  len = strlen(FORM_NAME) + strlen(name) + 2;
-  pbuf = XtStackAlloc(len, buf);
-  if (pbuf == NULL) return FALSE;
-  (void) sprintf(pbuf, "%s.%s", FORM_NAME, name);
+  (void) sprintf(buf, "%s.%s", FORM_NAME, name);
 
-  if ( (temp_widget = XtNameToWidget(shell, pbuf)) != NULL) {
+  if ( (temp_widget = XtNameToWidget(shell, buf)) != NULL) {
     SetResource(temp_widget, res_name, value);
-    XtStackFree(pbuf, buf);
     return(TRUE);
   }
-  XtStackFree(pbuf, buf);
   return(FALSE);
 }
 
diff --git a/lib/Xaw3d/XawAlloc.h b/lib/Xaw3d/XawAlloc.h
deleted file mode 100644
index ed0fe90..0000000
--- a/lib/Xaw3d/XawAlloc.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/* $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
-
diff --git a/lib/Xaw3d/XawI18n.h b/lib/Xaw3d/XawI18n.h
index a0e4d18..1b0ee5d 100644
--- a/lib/Xaw3d/XawI18n.h
+++ b/lib/Xaw3d/XawI18n.h
@@ -27,8 +27,6 @@ in this Software without prior written authorization from the X Consortium.
 
 ********************************************************/
 
-/* Mod for Debian by Joey Hess, do not include widec.h */
-#if 0
 #ifdef HAS_WCTYPE_H
 #include <wctype.h>
 #include <widec.h>
@@ -36,7 +34,6 @@ in this Software without prior written authorization from the X Consortium.
 #define wcscpy(d,s) wscpy(d,s)
 #define wcsncpy(d,s,l) wsncpy(d,s,l)
 #endif
-#endif /* 0 */
 
 #ifdef HAS_WCHAR_H
 #include <wchar.h>
-- 
1.7.10


--- End Message ---
--- Begin Message ---
Source: xaw3d
Source-Version: 1.5+F-1
Done: Francesco Paolo Lovergine <[email protected]>

We believe that the bug you reported is fixed in the latest version of
xaw3d, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Francesco Paolo Lovergine <[email protected]> (supplier of updated xaw3d 
package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Thu, 07 Jan 2021 19:57:42 +0100
Source: xaw3d
Architecture: source
Version: 1.5+F-1
Distribution: unstable
Urgency: medium
Maintainer: Francesco Paolo Lovergine <[email protected]>
Changed-By: Francesco Paolo Lovergine <[email protected]>
Closes: 670732 932562
Changes:
 xaw3d (1.5+F-1) unstable; urgency=medium
 .
   * Reassembled original tarball to cope with dquilt.
   * Revamped package with source format 3.0 and modern compat for dh.
     (closes: #670732)
   * Removed obsolete flex-old b-d. (closes: #932562)
   * Policy bumped to 4.5.1.
   * Added Vcs-* fields to d/control.
Checksums-Sha1:
 d92c29c31165f31463031abaded475a75df57345 1983 xaw3d_1.5+F-1.dsc
 6b8ac791d31afec41e8c60b3ee536d5e240d1e31 320013 xaw3d_1.5+F.orig.tar.gz
 82c14db5fe711a23ab0101cacd48834d4b462111 16008 xaw3d_1.5+F-1.debian.tar.xz
 a9dd184166d92109ffa28bfe7511eb3ecf3f9c4b 7142 xaw3d_1.5+F-1_amd64.buildinfo
Checksums-Sha256:
 ec2ad8d983ddf4ad7c983f88497269ea7cddeb5bcaec3f4b5ab6f55f513d7a1c 1983 
xaw3d_1.5+F-1.dsc
 9d731ce59d64ff1319412c0ce37acdcefc29eb9a12bece607407a44a0c3a9a7f 320013 
xaw3d_1.5+F.orig.tar.gz
 dd5ea0ab5c4b7d1ca6b95f43218257c4dcbe421faf9b01b62dbf3770cb1872b7 16008 
xaw3d_1.5+F-1.debian.tar.xz
 236894b81fa34ae3c20152b71e39585da63921bab353ab7cae01ab6891fb5b68 7142 
xaw3d_1.5+F-1_amd64.buildinfo
Files:
 7c7d9f25a3db332eff204b02044c4ff1 1983 x11 optional xaw3d_1.5+F-1.dsc
 182378ca9a69042cfd724f25d69a2f30 320013 x11 optional xaw3d_1.5+F.orig.tar.gz
 ef42c378b17463d0fc75f335b53c2baf 16008 x11 optional xaw3d_1.5+F-1.debian.tar.xz
 db404b303cb318842125bb044781e621 7142 x11 optional 
xaw3d_1.5+F-1_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQJHBAEBCgAxFiEEBXmpeiI46/m+Ye0CDwKl4RY2hqQFAl/3Wl0THGZyYW5raWVA
ZGViaWFuLm9yZwAKCRAPAqXhFjaGpIpuD/4pGgBYGfBSWW7P33QSDggjfZwLFAuX
9TQ04Yk+0BvQ6JR23mzDDpUgRumydImU7cK0tlYizlKB5z94TWX/iSuH5QFasbFA
ujXjrOMmXOEIdZG345CfOVv1+KvqxcHDXUgF7gILM8dhE2uVijS2y5ezgikpjHGV
1MCHd78j1sRG/9sXqOy8t+iD+u4lejVgg/C3/9qf8FgdKfnRpgSgphPs1QkIvGPp
JWkFmlU7JSSqBg/0xg9o2F1M8GhUa8hDjj78jDASM7OtJgQ7Tl9UN6a6do/Wccnj
i8ICU1FkAw1ryMhhV9TzpyFtJFnYxoguz5umFtfuJN7wTtm4VOXZ/kA6xkR7XKt/
+Ese6sgmpm9PforgAwMeBEQQ4EXVXK9WPUgBCzFKceY82+Y5r183bI7FxvyZiBAw
KJb426MYjGLtDA5Tk3u4m7cq7IjZYLlr0gEhQDDcfIODVIaeIoc+9otG4ptjlZyl
OGZRQA8aeGOb7OaU76eLHsF5OwBz1mT0QmXF0CHF7AO+jKj3G5dC+VPfWEtSI2Dz
HCm0GCwRLBKG/3NiO1OXQqaEjbI1u4Y3Axfm7Cx1VJgmOrmPE1mtImp6qRY+eynM
MUo+3p0meXJ6l2w682nYlsYnG+0bW4VehUjf4DYAQAHd6f9KB4P7b6SxkFhmU8lo
t66JM3UB+/VvHw==
=sB7t
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to