ftp.nice.ch/pub/next/unix/admin/msend.1.0.N.bs.tar.gz#/msend/fwdloop.c

This is fwdloop.c in view mode; [Download] [Up]

/* fwdloop.c:
 *
 * check for obvious forwarding loops
 *
 * (c) Copyright 1988, 1989, 1990 Jim Frost.  All Rights Reserved.  Please see
 * the accompanying file "Copyright" for more information.
 */

#include "Copyright"
#include "config.h"
#include "msend.h"

/* check for a local forwarding loop
 */

int fwdloop(host)
char *host;
{ struct hostent *h;
  char hname[MAXHOSTNAME+1];

  gethostname(hname,MAXHOSTNAME);
  h= gethostbyname(hname);
  if (strcmp(h->h_name,host)) {  /* obvious match? */

    /* look through alias list to see if it's one of the possible names
     */

    for (; (*h->h_aliases) && strcmp(*h->h_aliases,host); h->h_aliases++)
      ;
    return(*h->h_aliases != NULL);  
  }
  return(1);
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.