Browse Source

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>
Jim Cromie 13 years ago
parent
commit
8bd6026e88
1 changed files with 2 additions and 0 deletions
  1. 2 0
      lib/dynamic_debug.c

+ 2 - 0
lib/dynamic_debug.c

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