mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-09-27 14:00:45 -04:00
67 lines
2.1 KiB
Plaintext
67 lines
2.1 KiB
Plaintext
$NetBSD: patch-aa,v 1.6 2016/05/01 19:56:40 dholland Exp $
|
|
|
|
- Use ctype.h functions properly.
|
|
- Silence debug prints.
|
|
- Don't assume :0 if DISPLAY isn't set.
|
|
|
|
--- src/main.c.orig 2005-06-20 16:10:19.000000000 +0000
|
|
+++ src/main.c
|
|
@@ -196,7 +196,7 @@ xerror_handler (Display * dpy, XErrorEve
|
|
void
|
|
color_aliases(int idx)
|
|
{
|
|
- if (rs_color[idx] && isdigit(*rs_color[idx])) {
|
|
+ if (rs_color[idx] && isdigit((unsigned char)*rs_color[idx])) {
|
|
int i = atoi(rs_color[idx]);
|
|
|
|
if (i >= 8 && i <= 15) { /* bright colors */
|
|
@@ -1037,12 +1037,10 @@ resize_window(XEvent* ev)
|
|
XConfigureEvent *xconf = &(ev->xconfigure);
|
|
|
|
while( XCheckTypedWindowEvent( Xdisplay, TermWin.parent, ConfigureNotify, ev ) );
|
|
- fprintf( stderr, "config_geom = %dx%d\n", xconf->width, xconf->height );
|
|
resize_window1(xconf->width, xconf->height);
|
|
#if 1
|
|
XTranslateCoordinates (Xdisplay, TermWin.parent, Xroot, 0, 0, &root_x, &root_y, &wdumm);
|
|
|
|
- fprintf( stderr, "root_geom = %dx%d%+d%+d, root_size = %dx%d\n", xconf->width, xconf->height, root_x, root_y, XdisplayWidth, XdisplayHeight );
|
|
TermWin.root_x = root_x ;
|
|
TermWin.root_y = root_y ;
|
|
TermWin.root_width = xconf->width ;
|
|
@@ -1215,7 +1213,7 @@ set_window_color(int idx, const char *co
|
|
return;
|
|
|
|
/* handle color aliases */
|
|
- if (isdigit(*color)) {
|
|
+ if (isdigit((unsigned char)*color)) {
|
|
i = atoi(color);
|
|
if (i >= 8 && i <= 15) { /* bright colors */
|
|
i -= 8;
|
|
@@ -1432,7 +1430,7 @@ change_font(int init, const char *fontna
|
|
break;
|
|
|
|
default:
|
|
- if (fontname[1] != '\0' && !isdigit(fontname[1]))
|
|
+ if (fontname[1] != '\0' && !isdigit((unsigned char)fontname[1]))
|
|
return;
|
|
if (idx < 0 || idx >= (NFONTS))
|
|
return;
|
|
@@ -2047,9 +2045,14 @@ main(int argc, char *argv[])
|
|
*/
|
|
get_options(argc, argv);
|
|
|
|
- if( display_name == NULL )
|
|
- if ((display_name = getenv("DISPLAY")) == NULL)
|
|
- display_name = ":0";
|
|
+ if( display_name == NULL )
|
|
+ display_name = getenv("DISPLAY");
|
|
+
|
|
+ if( display_name == NULL )
|
|
+ {
|
|
+ print_error("DISPLAY variable not set and none given");
|
|
+ exit(EXIT_FAILURE);
|
|
+ }
|
|
|
|
#ifdef HAVE_AFTERSTEP
|
|
#ifdef MyArgs_IS_MACRO
|