OSDN Git Service

tracetool: dtrace: handle in and next reserved words
authorAlon Levy <alevy@redhat.com>
Thu, 29 Mar 2012 21:35:36 +0000 (23:35 +0200)
committerStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Fri, 30 Mar 2012 10:55:21 +0000 (11:55 +0100)
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
scripts/tracetool

index a279c2c..5e77aa2 100755 (executable)
@@ -506,10 +506,12 @@ EOF
     i=1
     for arg in $arglist
     do
-        # 'limit' is a reserved keyword
-        if [ "$arg" = "limit" ]; then
-          arg="_limit"
-        fi
+        # postfix reserved words with '_'
+        case "$arg" in
+            limit|in|next|self)
+                arg="${arg}_"
+                ;;
+        esac
         cat <<EOF
   $arg = \$arg$i;
 EOF