lkml.org 
[lkml]   [2011]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 13/25] dynamic_debug: chop off comments in ddebug_tokenize
    Date
    From: Jim Cromie <jim.cromie@gmail.com>

    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>
    ---
    lib/dynamic_debug.c | 2 ++
    1 files changed, 2 insertions(+), 0 deletions(-)

    diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
    index aaa29dc..d285bb5 100644
    --- a/lib/dynamic_debug.c
    +++ b/lib/dynamic_debug.c
    @@ -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 == '\'') {
    --
    1.7.7.3


    \
     
     \ /
      Last update: 2011-12-13 00:19    [W:0.020 / U:3.492 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site