Skip to content

Commit

Permalink
dynamic_debug: chop off comments in ddebug_tokenize
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jim Cromie authored and Greg Kroah-Hartman committed Jan 24, 2012
1 parent e703dda commit 8bd6026
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/dynamic_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 == '\'') {
Expand Down

0 comments on commit 8bd6026

Please sign in to comment.