summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorstanton <stanton>1998-11-25 21:16:28 (GMT)
committerstanton <stanton>1998-11-25 21:16:28 (GMT)
commit0fe03c2e56a2ab06690ea189ab1136b35f5f80b6 (patch)
tree4ad0c5e136a5786750291df60b74a1358a56c774 /unix
parentcfaf90b6bd984f4e72ed307384968bcad79500d5 (diff)
downloadtk-0fe03c2e56a2ab06690ea189ab1136b35f5f80b6.zip
tk-0fe03c2e56a2ab06690ea189ab1136b35f5f80b6.tar.gz
tk-0fe03c2e56a2ab06690ea189ab1136b35f5f80b6.tar.bz2
* integrated tk8.0.4 changes.
* generic/tkBind.c: fixed deletion order bug where a crash would result if a binding deleted "."
Diffstat (limited to 'unix')
-rw-r--r--unix/Makefile.in4
-rw-r--r--unix/configure.in4
-rw-r--r--unix/tkUnixFont.c31
3 files changed, 35 insertions, 4 deletions
diff --git a/unix/Makefile.in b/unix/Makefile.in
index 038bd2c..59f5e1d 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -5,7 +5,7 @@
# "autoconf" program (constructs like "@foo@" will get replaced in the
# actual Makefile.
#
-# RCS: @(#) $Id: Makefile.in,v 1.1.4.2 1998/09/30 02:19:10 stanton Exp $
+# RCS: @(#) $Id: Makefile.in,v 1.1.4.3 1998/11/25 21:16:40 stanton Exp $
# Current Tk version; used in various names.
@@ -194,7 +194,7 @@ TK_LD_SEARCH_FLAGS = @TK_LD_SEARCH_FLAGS@
# modify any of this stuff by hand.
#----------------------------------------------------------------
-AC_FLAGS = @DEFS@
+AC_FLAGS = @EXTRA_CFLAGS@ @DEFS@
RANLIB = @RANLIB@
SRC_DIR = @srcdir@/..
TOP_DIR = @srcdir@/..
diff --git a/unix/configure.in b/unix/configure.in
index 920a0f5..d0a45a9 100644
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run during Tk installation
dnl to configure the system for the local environment.
AC_INIT(../generic/tk.h)
-# RCS: @(#) $Id: configure.in,v 1.1.4.2 1998/09/30 02:19:11 stanton Exp $
+# RCS: @(#) $Id: configure.in,v 1.1.4.3 1998/11/25 21:16:41 stanton Exp $
TK_VERSION=8.1
TK_MAJOR_VERSION=8
@@ -89,6 +89,7 @@ DL_LIBS=$TCL_DL_LIBS
LD_FLAGS=$TCL_LD_FLAGS
CFLAGS_DEBUG=$TCL_CFLAGS_DEBUG
CFLAGS_OPTIMIZE=$TCL_CFLAGS_OPTIMIZE
+EXTRA_CFLAGS=$TCL_EXTRA_CFLAGS
LIB_RUNTIME_DIR='${LIB_RUNTIME_DIR}'
@@ -408,6 +409,7 @@ AC_SUBST(CFLAGS_OPTIMIZE)
AC_SUBST(CFLAGS_WARNING)
AC_SUBST(TK_DBGX)
AC_SUBST(DL_LIBS)
+AC_SUBST(EXTRA_CFLAGS)
AC_SUBST(LD_FLAGS)
AC_SUBST(MATH_LIBS)
AC_SUBST(MAKE_LIB)
diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c
index 88f31a0..2478af3 100644
--- a/unix/tkUnixFont.c
+++ b/unix/tkUnixFont.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixFont.c,v 1.1.4.2 1998/09/30 02:19:18 stanton Exp $
+ * RCS: @(#) $Id: tkUnixFont.c,v 1.1.4.3 1998/11/25 21:16:41 stanton Exp $
*/
#include "tkUnixInt.h"
@@ -420,6 +420,35 @@ TkpGetNativeFont(tkwin, name)
UnixFont *fontPtr;
XFontStruct *fontStructPtr;
FontAttributes fa;
+ char *p;
+ int hasSpace, dashes, hasWild;
+
+ /*
+ * The behavior of X when given a name that isn't an XLFD is unspecified.
+ * For example, Exceed 6 returns a valid font for any random string. This
+ * is awkward since system names have higher priority than the other Tk
+ * font syntaxes. So, we need to perform a quick sanity check on the
+ * name and fail if it looks suspicious. We fail if the name:
+ * - contains a space immediately before a dash
+ * - contains a space, but no '*' characters and fewer than 14 dashes
+ */
+
+ hasSpace = dashes = hasWild = 0;
+ for (p = name; *p != '\0'; p++) {
+ if (*p == ' ') {
+ if (p[1] == '-') {
+ return NULL;
+ }
+ hasSpace = 1;
+ } else if (*p == '-') {
+ dashes++;
+ } else if (*p == '*') {
+ hasWild = 1;
+ }
+ }
+ if ((dashes < 14) && !hasWild && hasSpace) {
+ return NULL;
+ }
fontStructPtr = XLoadQueryFont(Tk_Display(tkwin), name);
if (fontStructPtr == NULL) {