3
0

skip_whitespace.c 468 B

12345678910111213141516171819202122232425
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * skip_whitespace implementation for busybox
  4. *
  5. * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
  6. *
  7. * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
  8. */
  9. #include "libbb.h"
  10. char *skip_whitespace(const char *s)
  11. {
  12. /* NB: isspace('0') returns 0 */
  13. while (isspace(*s)) ++s;
  14. return (char *) s;
  15. }
  16. char *skip_non_whitespace(const char *s)
  17. {
  18. while (*s && !isspace(*s)) ++s;
  19. return (char *) s;
  20. }