Blame src/lib/skip_whitespace.c

Packit Service 779887
/* vi: set sw=4 ts=4: */
Packit Service 779887
/*
Packit Service 779887
 * Copyright (C) 2003  Manuel Novoa III  <mjn3@codepoet.org>
Packit Service 779887
 *
Packit Service 779887
 * This program is free software; you can redistribute it and/or modify
Packit Service 779887
 * it under the terms of the GNU General Public License as published by
Packit Service 779887
 * the Free Software Foundation; either version 2 of the License, or
Packit Service 779887
 * (at your option) any later version.
Packit Service 779887
 *
Packit Service 779887
 * This program is distributed in the hope that it will be useful,
Packit Service 779887
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 779887
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 779887
 * GNU General Public License for more details.
Packit Service 779887
 *
Packit Service 779887
 * You should have received a copy of the GNU General Public License along
Packit Service 779887
 * with this program; if not, write to the Free Software Foundation, Inc.,
Packit Service 779887
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Packit Service 779887
 */
Packit Service 779887
#include "internal_libreport.h"
Packit Service 779887
Packit Service 779887
char* skip_blank(const char *s)
Packit Service 779887
{
Packit Service 779887
	while (isblank(*s)) ++s;
Packit Service 779887
Packit Service 779887
	return (char *) s;
Packit Service 779887
}
Packit Service 779887
Packit Service 779887
char* skip_whitespace(const char *s)
Packit Service 779887
{
Packit Service 779887
	/* NB: isspace('\0') returns 0 */
Packit Service 779887
	while (isspace(*s)) ++s;
Packit Service 779887
Packit Service 779887
	return (char *) s;
Packit Service 779887
}
Packit Service 779887
Packit Service 779887
char* skip_non_whitespace(const char *s)
Packit Service 779887
{
Packit Service 779887
	while (*s && !isspace(*s)) ++s;
Packit Service 779887
Packit Service 779887
	return (char *) s;
Packit Service 779887
}