[hackers] [st] removed XINERAMA from config.mk and fixed a segfault when st is || Aurélien Aptel

From: <hg_AT_suckless.org>
Date: Fri, 27 Aug 2010 09:53:14 +0000 (UTC)

changeset: 97:dfef8c8727d9
tag: tip
user: Aurélien Aptel <aurelien.aptel_AT_gmail.com>
date: Fri Aug 27 13:53:27 2010 +0200
files: config.mk st.c
description:
removed XINERAMA from config.mk and fixed a segfault when st is
started without a display. (thx Hiltjo Posthuma)

diff -r 7a97a8448401 -r dfef8c8727d9 config.mk
--- a/config.mk Fri Aug 27 00:58:28 2010 +0200
+++ b/config.mk Fri Aug 27 13:53:27 2010 +0200
@@ -10,16 +10,12 @@
 X11INC = /usr/X11R6/include
 X11LIB = /usr/X11R6/lib
 
-# Xinerama, comment if you don't want it
-#XINERAMALIBS = -L${X11LIB} -lXinerama
-#XINERAMAFLAGS = -DXINERAMA
-
 # includes and libs
 INCS = -I. -I/usr/include -I${X11INC}
-LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 ${XINERAMALIBS}
+LIBS = -L/usr/lib -lc -L${X11LIB} -lX11
 
 # flags
-CPPFLAGS = -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
+CPPFLAGS = -DVERSION=\"${VERSION}\"
 CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
 LDFLAGS = -s ${LIBS}
 
diff -r 7a97a8448401 -r dfef8c8727d9 st.c
--- a/st.c Fri Aug 27 00:58:28 2010 +0200
+++ b/st.c Fri Aug 27 13:53:27 2010 +0200
@@ -1078,10 +1078,9 @@
 
 void
 xinit(void) {
- xw.dis = XOpenDisplay(NULL);
+ if(!(xw.dis = XOpenDisplay(NULL)))
+ die("Can't open display\n");
         xw.scr = XDefaultScreen(xw.dis);
- if(!xw.dis)
- die("Can't open display\n");
         
         /* font */
         if(!(dc.font = XLoadQueryFont(xw.dis, FONT)) || !(dc.bfont = XLoadQueryFont(xw.dis, BOLDFONT)))
Received on Fri Aug 27 2010 - 11:53:14 CEST

This archive was generated by hypermail 2.2.0 : Fri Aug 27 2010 - 12:00:07 CEST