Mercurial > hg > Applications > mh
view sbr/trimcpy.c @ 3:f89a9a79e124
utf-8
author | kono |
---|---|
date | Wed, 20 Apr 2005 00:25:01 +0900 |
parents | bce86c4163a3 |
children | 441a2190cfae |
line wrap: on
line source
/* trimcpy.c - strip [lt]wsp and replace newlines with spaces */ #ifndef lint static char ident[] = "@(#)$Id$"; #endif /* lint */ #include "../h/mh.h" #include <ctype.h> #include <stdio.h> char *trimcpy (cp) register char *cp; { register char *sp; while (isspace (*cp & 0xff)) cp++; for (sp = cp + strlen (cp) - 1; sp >= cp; sp--) if (isspace (*sp & 0xff)) *sp = 0; else break; for (sp = cp; *sp; sp++) if (isspace (*sp & 0xff)) *sp = ' '; return getcpy (cp); }