Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!husc6!ut-sally!ut-ngp!clyde From: clyde@ut-ngp.UUCP Newsgroups: comp.windows.x Subject: Bugs in uwm/menuwm for SUNs Message-ID: <4892@ut-ngp.UUCP> Date: Wed, 25-Mar-87 18:42:25 EST Article-I.D.: ut-ngp.4892 Posted: Wed Mar 25 18:42:25 1987 Date-Received: Fri, 27-Mar-87 04:46:09 EST Organization: Moose & Squirrel Software Lines: 131 Keywords: uwm & menuwm busted on SUN *** Yet another in a series of X boo-boos (collect them all)! *** Uwm and derivitatives (such as menuwm) will fail on SUNs if DISPLAY is NOT set to "unix:0". This is because on the SUN, gethostbyname() causes RPC and YP calls. Deep (and I mean DEEP) in the YP code, there is use of the system call call 'bind()'. Now, in 'gram.y' there is a routine named, you guessed it, 'bind()'. FLAME ON !! DAMMIT, DON'T USE THE NAMES OF ANYTHING IN SECTIONS 2 OR 3 OF THE UNIX PROGRAMMERS' MANUAL AS YOUR OWN ROUTINE NAMES!!! This is pure unalloyed stupidity! It causes the most insidious kind of errors which are a real pain to track done even with source, and totally screws users who don't have source! FLAME OFF .. Now, this fix and another fix for a null-dereferncing error found in menuwm. [ HEY GUYS, the whole damn world doesn't use a VAX! ] --------------- CUT HERE ------------------------ *** gram.y.r1.1 Wed Mar 25 17:19:59 1987 --- gram.y Wed Mar 25 17:19:01 1987 *************** *** 137,143 case IsNowFunction: case IsFunction: if ($3 == C_MAP) { ! bind($1, bkmask, cmask, NULL); } else yyerror("illegal construct"); break; case IsDownFunction: --- 138,144 ----- case IsNowFunction: case IsFunction: if ($3 == C_MAP) { ! Bind($1, bkmask, cmask, NULL); } else yyerror("illegal construct"); break; case IsDownFunction: *************** *** 148,154 yyerror(msg); } if ($3 == C_MAP) { ! bind($1, bkmask, cmask, NULL); } else yyerror("illegal construct"); break; case IsMenuMap: --- 149,155 ----- yyerror(msg); } if ($3 == C_MAP) { ! Bind($1, bkmask, cmask, NULL); } else yyerror("illegal construct"); break; case IsMenuMap: *************** *** 159,165 yyerror(msg); } if ($3 == C_MENUMAP) { ! bind($1, bkmask, cmask, menu_name); } else yyerror("illegal construct"); break; case IsMenu: --- 160,166 ----- yyerror(msg); } if ($3 == C_MENUMAP) { ! Bind($1, bkmask, cmask, menu_name); } else yyerror("illegal construct"); break; case IsMenu: *************** *** 525,531 /* * Bind button/key/context to a function. */ ! bind(index, mask, context, name) int index; /* Index into keyword table. */ short mask; /* Button/key/modifier mask. */ int context; /* ROOT, WINDOW, or ICON. */ --- 526,532 ----- /* * Bind button/key/context to a function. */ ! Bind(index, mask, context, name) int index; /* Index into keyword table. */ short mask; /* Button/key/modifier mask. */ int context; /* ROOT, WINDOW, or ICON. */ *************** *** 643,653 { MenuLine *ptr; ! if(!list) list = line; ! for(ptr = list; ptr->line; ptr = ptr->line) /* NULL */; ! ptr->line = line; ! ptr = ptr->line; ! ptr->line = NULL; return(list); } --- 644,659 ----- { MenuLine *ptr; ! if (line == NULL) ! return(NULL); ! if (list == NULL) ! list = line; ! else { ! for(ptr = list; ptr->line; ptr = ptr->line) /* NULL */; ! ptr->line = line; ! ptr = ptr->line; ! ptr->line = NULL; ! } return(list); } -- Shouter-To-Dead-Parrots @ Univ. of Texas Computation Center; Austin, Texas clyde@ngp.cc.utexas.edu; ...!ut-sally!ut-ngp!clyde "It's a sort of a threat, you see. I've never been very good at them myself, but I've told they can be very effective."