home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / snip9707.zip / RMLEAD.C < prev    next >
C/C++ Source or Header  |  1997-07-05  |  947b  |  41 lines

  1. /* +++Date last modified: 05-Jul-1997 */
  2.  
  3. /*
  4. **  Originally published as part of the MicroFirm Function Library
  5. **
  6. **  Copyright 1986, S.E. Margison
  7. **  Copyright 1989, Robert B.Stout
  8. **
  9. **  The user is granted a free limited license to use this source file
  10. **  to create royalty-free programs, subject to the terms of the
  11. **  license restrictions specified in the LICENSE.MFL file.
  12. **
  13. **  remove leading whitespace from a string
  14. */
  15.  
  16. #include <ctype.h>
  17. #include <string.h>
  18. #include "snip_str.h"                     /* Contains strMove() macro   */
  19.  
  20. #if defined(__cplusplus) && __cplusplus
  21.  extern "C" {
  22. #endif
  23.  
  24. char *rmlead(char *str)
  25. {
  26.       char *obuf;
  27.  
  28.       if (str)
  29.       {
  30.             for (obuf = str; *obuf && isspace(*obuf); ++obuf)
  31.                   ;
  32.             if (str != obuf)
  33.                   strMove(str, obuf);
  34.       }
  35.       return str;
  36. }
  37.  
  38. #if defined(__cplusplus) && __cplusplus
  39.  }
  40. #endif
  41.