dynamic_debug: chop off comments in ddebug_tokenize
authorJim Cromie <jim.cromie@gmail.com>
Mon, 19 Dec 2011 22:13:03 +0000 (17:13 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 24 Jan 2012 20:48:54 +0000 (12:48 -0800)
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>
lib/dynamic_debug.c

index 4be55d8d76b81326d3859679c31d4443f860ee7c..86a9abb9a1ce832e3872d7a4f5d553c4a147447e 100644 (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 == '\'') {