dect
/
linux-2.6
Archived
13
0
Fork 0

dynamic_debug: chop off comments in ddebug_tokenize

If a token begins with #, the remainder of query string is a comment,
so drop it.  Doing it here avoids '#' in quoted strings.

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Jim Cromie 2011-12-19 17:13:03 -05:00 committed by Greg Kroah-Hartman
parent e703ddae38
commit 8bd6026e88
1 changed files with 2 additions and 0 deletions

View File

@ -183,6 +183,8 @@ static int ddebug_tokenize(char *buf, char *words[], int maxwords)
buf = skip_spaces(buf);
if (!*buf)
break; /* oh, it was trailing whitespace */
if (*buf == '#')
break; /* token starts comment, skip rest of line */
/* find `end' of word, whitespace separated or quoted */
if (*buf == '"' || *buf == '\'') {