예제 #1
0
static char *parse_word(char **buf)
{
    char *word, *next;

    word = *buf;
    if (*word == 0)
        return 0;

    word = skip_over_blank(word);
    next = skip_over_word(word);
    if (*next)
        *next++ = 0;
    *buf = next;
    return word;
}
예제 #2
0
static char *strip_line(char *line)
{
	char	*p;

	line = skip_over_blank(line);

	p = line + strlen(line) - 1;

	while (*line) {
		if (isspace(*p))
			*p-- = '\0';
		else
			break;
	}

	return line;
}
예제 #3
0
static char *parse_word(char **buf)
{
	char *word, *next;

	word = *buf;
	if (*word == '\0')
		return NULL;

	word = skip_over_blank(word);
	next = skip_over_word(word);
	if (*next) {
		char *end = next - 1;
		if (*end == '"' || *end == '\'')
			*end = '\0';
		*next++ = '\0';
	}
	*buf = next;

	if (*word == '"' || *word == '\'')
		word++;
	return word;
}