home *** CD-ROM | disk | FTP | other *** search
/ ftp.uv.es / 2014.11.ftp.uv.es.tar / ftp.uv.es / pub / unix / elm-2.4-pl20.tar.Z / elm-2.4-pl20.tar / lib / add_site.c next >
C/C++ Source or Header  |  1992-10-03  |  1KB  |  52 lines

  1.  
  2. static char rcsid[] = "@(#)$Id: add_site.c,v 5.1 1992/10/03 22:41:36 syd Exp $";
  3.  
  4. /*******************************************************************************
  5.  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
  6.  *
  7.  *            Copyright (c) 1988-1992 USENET Community Trust
  8.  *            Copyright (c) 1986,1987 Dave Taylor
  9.  *******************************************************************************
  10.  * Bug reports, patches, comments, suggestions should be sent to:
  11.  *
  12.  *    Syd Weinstein, Elm Coordinator
  13.  *    elm@DSI.COM            dsinc!elm
  14.  *
  15.  *******************************************************************************
  16.  * $Log: add_site.c,v $
  17.  * Revision 5.1  1992/10/03  22:41:36  syd
  18.  * Initial checkin as of 2.4 Release at PL0
  19.  *
  20.  *
  21.  ******************************************************************************/
  22.  
  23. /** 
  24.  
  25. **/
  26.  
  27. #include "headers.h"
  28.  
  29. add_site(buffer, site, lastsite)
  30. char *buffer, *site, *lastsite;
  31. {
  32.     /** add site to buffer, unless site is 'uucp' or site is
  33.         the same as lastsite.   If not, set lastsite to site.
  34.     **/
  35.  
  36.     char local_buffer[SLEN], *stripped;
  37.     char *strip_parens();
  38.  
  39.     stripped = strip_parens(site);
  40.  
  41.     if (istrcmp(stripped, "uucp") != 0)
  42.       if (strcmp(stripped, lastsite) != 0) {
  43.         if (buffer[0] == '\0')
  44.           strcpy(buffer, stripped);         /* first in list! */
  45.         else {
  46.           sprintf(local_buffer,"%s!%s", buffer, stripped);
  47.           strcpy(buffer, local_buffer);
  48.         }
  49.         strcpy(lastsite, stripped); /* don't want THIS twice! */
  50.       }
  51. }
  52.