Patchwork [2/4] trace: Don't strip lines containing '#' arbitrarily

login
register
mail settings
Submitter Stefan Hajnoczi
Date Oct. 5, 2010, 1:28 p.m.
Message ID <1286285333-21003-2-git-send-email-stefanha@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/66846/
State New
Headers show

Comments

Stefan Hajnoczi - Oct. 5, 2010, 1:28 p.m.
Although comment lines must be skipped, the '#' character can occur in
valid format strings.  Be more careful when checking for comments.
Leave comments at the end of the line where they will not interfere with
other processing.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 tracetool |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Patch

diff --git a/tracetool b/tracetool
index 534cc70..63e3e29 100755
--- a/tracetool
+++ b/tracetool
@@ -318,8 +318,7 @@  convert()
 
     while read -r str; do
         # Skip comments and empty lines
-        str=${str%%#*}
-        test -z "$str" && continue
+        test -z "${str%%#*}" && continue
 
         # Process the line.  The nop backend handles disabled lines.
         disable=${str%%disable *}