[762] in SIPB_Linux_Development

home help back first fref pref prev next nref lref last post

Patch for lpr/printcap.c

daemon@ATHENA.MIT.EDU (Jim Haynes)
Thu Oct 20 14:15:21 1994

From: haynes@cats.ucsc.edu (Jim Haynes)
Date: Thu, 20 Oct 1994 11:15:01 -0700
To: linux-dev@MIT.EDU

Patch for lpr/printcap.c
You don't really need this at MIT where hostname is not a fully qualified
domain name; but in the general case where they might be this patch makes
Hesiod lookups work.

*** 1.1	1994/10/20 05:29:42
--- printcap.c	1994/10/20 05:31:05
***************
*** 68,73 ****
--- 68,74 ----
  char	*tgetstr();
  char	*tdecode();
  char	*getenv();
+ char	*strchr();
  
  #ifdef HESIOD
  /* Ask Hesiod if printer name is an alias.  If so,
***************
*** 120,128 ****
--- 121,132 ----
  	static char cluster[BUFSIZ/2];
  	char host[32];
  	char **hv;
+ 	char *i;
  	int len = 4;  /* length of string "lpr " */
  
  	gethostname(host, sizeof (host));
+ 	if (i = strchr(host, '.'))
+ 		*i = '\0';
  	if ((hv = hes_resolve(host, "cluster")) == NULL)
  		return NULL;
  	while (*hv) {

home help back first fref pref prev next nref lref last post