ftp.nice.ch/pub/next/unix/mail/mh.6.7.s.tar.gz#/mh/sbr/trimcpy.c

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

/* trimcpy.c - strip [lt]wsp and replace newlines with spaces */

#include "../h/mh.h"
#include <ctype.h>
#include <stdio.h>


char *trimcpy (cp)
register char *cp;
{
    register char  *sp;

    while (isspace (*cp))
	cp++;
    for (sp = cp + strlen (cp) - 1; sp >= cp; sp--)
	if (isspace (*sp))
	    *sp = NULL;
	else
	    break;
    for (sp = cp; *sp; sp++)
	if (isspace (*sp))
	    *sp = ' ';

    return getcpy (cp);
}

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