From 7542ec4f2028b5b154dd1f1777a1d07b585e4b52 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 25 Sep 2009 00:53:15 +0200 Subject: command: relax requirements for unquoted words Allow most printable characters in unquoted words. The tokenizer patch introduced very strict requirements for command parameters - those were undocumented, and we're reverting the strictness now. --- src/tokenizer.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/tokenizer.h') diff --git a/src/tokenizer.h b/src/tokenizer.h index e0238f0a..ce4c37cc 100644 --- a/src/tokenizer.h +++ b/src/tokenizer.h @@ -36,6 +36,20 @@ char * tokenizer_next_word(char **input_p, GError **error_r); +/** + * Reads the next unquoted word from the input string. This function + * modifies the input string. + * + * @param input_p the input string; this function returns a pointer to + * the first non-whitespace character of the following token + * @param error_r if this function returns NULL and **input_p!=0, it + * optionally provides a GError object in this argument + * @return a pointer to the null-terminated word, or NULL on error or + * end of line + */ +char * +tokenizer_next_unquoted(char **input_p, GError **error_r); + /** * Reads the next quoted string from the input string. A backslash * escapes the following character. This function modifies the input @@ -52,8 +66,9 @@ char * tokenizer_next_string(char **input_p, GError **error_r); /** - * Reads the next word or quoted string from the input. This is a - * wrapper for tokenizer_next_word() and tokenizer_next_string(). + * Reads the next unquoted word or quoted string from the input. This + * is a wrapper for tokenizer_next_unquoted() and + * tokenizer_next_string(). * * @param input_p the input string; this function returns a pointer to * the first non-whitespace character of the following token @@ -63,6 +78,6 @@ tokenizer_next_string(char **input_p, GError **error_r); * or end of line */ char * -tokenizer_next_word_or_string(char **input_p, GError **error_r); +tokenizer_next_param(char **input_p, GError **error_r); #endif -- cgit v1.2.3