]> granicus.if.org Git - strace/commitdiff
xlat/gen.sh: speedup, part 5
authorEugene Syromyatnikov <evgsyr@gmail.com>
Tue, 5 Feb 2019 23:49:47 +0000 (00:49 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 24 Feb 2019 23:37:00 +0000 (23:37 +0000)
* xlat/gen.sh (gen_header): Process xlat line with sed only when "/*"
substring is present in it.

Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
xlat/gen.sh

index 9a9d6222445ae42bbeb66a48ca35945213e009c8..251b554a6bba97e78683219c200caf505edc9bbc 100755 (executable)
@@ -132,8 +132,12 @@ gen_header()
        local unconditional= line
        # 1st pass: output directives.
        while read line; do
-               line=$(printf "%s" "$line" | \
-                       sed "s|[[:space:]]*/\*.*\*/[[:space:]]*||")
+               case "$line" in
+                       */\**)
+                       line=$(printf "%s" "$line" |
+                               sed "s|[[:space:]]*/\*.*\*/[[:space:]]*||")
+                       ;;
+               esac
 
                case $line in
                '#stop')
@@ -201,8 +205,12 @@ gen_header()
        unconditional= val_type=
        # 2nd pass: output everything.
        while read line; do
-               line=$(printf "%s" "$line" | \
-                       sed "s|[[:space:]]*/\*.*\*/[[:space:]]*||")
+               case "$line" in
+                       */\**)
+                       line=$(printf "%s" "$line" |
+                               sed "s|[[:space:]]*/\*.*\*/[[:space:]]*||")
+                       ;;
+               esac
 
                case ${line} in
                '#conditional')