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 / shiftlower.c < prev    next >
C/C++ Source or Header  |  1992-10-03  |  1KB  |  54 lines

  1. static char rcsid[] = "@(#)$Id: shiftlower.c,v 5.1 1992/10/03 22:41:36 syd Exp $";
  2.  
  3. /*******************************************************************************
  4.  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
  5.  *
  6.  *            Copyright (c) 1988-1992 USENET Community Trust
  7.  *            Copyright (c) 1986,1987 Dave Taylor
  8.  *******************************************************************************
  9.  * Bug reports, patches, comments, suggestions should be sent to:
  10.  *
  11.  *    Syd Weinstein, Elm Coordinator
  12.  *    elm@DSI.COM            dsinc!elm
  13.  *
  14.  *******************************************************************************
  15.  * $Log: shiftlower.c,v $
  16.  * Revision 5.1  1992/10/03  22:41:36  syd
  17.  * Initial checkin as of 2.4 Release at PL0
  18.  *
  19.  *
  20.  ******************************************************************************/
  21.  
  22. /** 
  23.  
  24. **/
  25.  
  26. #include "headers.h"
  27.  
  28. #include <ctype.h>
  29.  
  30. #ifdef BSD
  31. #undef tolower
  32. #undef toupper
  33. #endif
  34.  
  35. char *shift_lower(string)
  36. char *string;
  37. {
  38.     /** return 'string' shifted to lower case.  Do NOT touch the
  39.         actual string handed to us! **/
  40.  
  41.     static char buffer[VERY_LONG_STRING];
  42.     register char *bufptr = buffer;
  43.  
  44.     for (; *string; string++, bufptr++)
  45.       if (isupper(*string))
  46.         *bufptr = tolower(*string);
  47.       else
  48.         *bufptr = *string;
  49.     
  50.     *bufptr = 0;
  51.     
  52.     return( (char *) buffer);
  53. }
  54.