1 /* $NetBSD: skipblanks.c,v 1.1.1.1 2009/06/23 10:09:00 tron Exp $ */ 2 3 /*++ 4 /* NAME 5 /* skipblanks 3 6 /* SUMMARY 7 /* skip leading whitespace 8 /* SYNOPSIS 9 /* #include <stringops.h> 10 /* 11 /* char *skipblanks(string) 12 /* const char *string; 13 /* DESCRIPTION 14 /* skipblanks() returns a pointer to the first non-whitespace 15 /* character in the specified string, or a pointer to the string 16 /* terminator when the string contains all white-space characters. 17 /* LICENSE 18 /* .ad 19 /* .fi 20 /* The Secure Mailer license must be distributed with this software. 21 /* AUTHOR(S) 22 /* Wietse Venema 23 /* IBM T.J. Watson Research 24 /* P.O. Box 704 25 /* Yorktown Heights, NY 10598, USA 26 /*--*/ 27 28 /* System library. */ 29 30 #include "sys_defs.h" 31 #include <ctype.h> 32 33 /* Utility library. */ 34 35 #include "stringops.h" 36 37 char *skipblanks(const char *string) 38 { 39 const char *cp; 40 41 for (cp = string; *cp != 0; cp++) 42 if (!ISSPACE(*cp)) 43 break; 44 return ((char *) cp); 45 } 46