trace: Don't strip lines containing '#' arbitrarily
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Tue, 5 Oct 2010 13:28:51 +0000 (14:28 +0100)
committerBlue Swirl <blauwirbel@gmail.com>
Sat, 9 Oct 2010 08:16:50 +0000 (08:16 +0000)
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>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
tracetool

index 534cc70..63e3e29 100755 (executable)
--- 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 *}