Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ncr-tp.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!talcott!panda!genrad!decvax!ittvax!dcdwest!sdcsvax!bmcg!sdcc6!ncr-tp!greg From: greg@ncr-tp.UUCP (Greg Noel) Newsgroups: net.sources.bugs Subject: Re: Bugs (and fixes) in pathalias Message-ID: <125@ncr-tp.UUCP> Date: Tue, 29-Jan-85 20:33:42 EST Article-I.D.: ncr-tp.125 Posted: Tue Jan 29 20:33:42 1985 Date-Received: Sat, 2-Feb-85 09:03:49 EST References: <328@desint.UUCP> Reply-To: greg@ncr-tp.UUCP (Greg Noel) Organization: NCR Corporation, Torrey Pines Lines: 71 In article <328@desint.UUCP> geoff@desint.UUCP (Geoff Kuenning) writes: >There are a couple of small problems with the latest posting of pathalias: > > (1) The commentary in the makefile neglects to mention that the program > uses 'index' and 'rindex'. USG sites should add -Dindex=strchr and > -Drindex=strrchr to their CFLAGS. > Well, almost. It turns out that this substitution is done automaticly in def.h but one file that uses index() does not #include it. The offending file is gethostnam.c, and an examinination of it reveals that this code will ALWAYS be present, despite the #ifndef that tries to prevent it, so that the library version of gethostname() will NEVER be used. Further perusal shows that gethostname() is only required if neither GETHOSTNAME nor UNAME is #defined; a site that had uname() but not gethostname() might set up config.h to indicate this condition, and would needlessly include the routine, so this should be tested as well. The diff for this is attached below. BTW, the diff in the referenced article should be applied to addnode.c, not pathalias.c as it indicates. *** gethostnam.orig Tue Jan 29 17:23:07 1985 --- gethostnam.c Tue Jan 29 15:36:10 1985 *************** *** 2,7 static char *sccsid = "@(#)gethostnam.c 6.1 (down!honey) 85/01/21"; #endif lint #ifndef GETHOSTNAME #include --- 2,9 ----- static char *sccsid = "@(#)gethostnam.c 6.1 (down!honey) 85/01/21"; #endif lint + #include "def.h" + #ifndef UNAME #ifndef GETHOSTNAME void *************** *** 3,9 #endif lint #ifndef GETHOSTNAME - #include void gethostname(name, len) --- 5,10 ----- #include "def.h" #ifndef UNAME #ifndef GETHOSTNAME void gethostname(name, len) *************** *** 53,55 return; } #endif GETHOSTNAME --- 54,57 ----- return; } #endif GETHOSTNAME + #endif UNAME -- -- Greg Noel, NCR Torrey Pines Greg@ncr-tp.UUCP or Greg@nosc.ARPA