]> granicus.if.org Git - strace/commitdiff
xlat: handle xlat constants that are not identifiers
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 5 Jun 2018 11:04:09 +0000 (11:04 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 5 Jun 2018 11:04:09 +0000 (11:04 +0000)
Extend xlat generator to support such input lines as
IPV4_DEVCONF_FORWARDING-1 0

This is going to be used later in IFLA_AF_SPEC decoding.

* xlat/gen.sh (cond_def): If the xlat value is not an identifier name,
extract an identifier name from the beginning of xlat value.

xlat/gen.sh

index 0c0119a7005dff95558b2f25347faad6f3e0f781..81f2096406157fc87fd24a01daf5adbb522eb6ad 100755 (executable)
@@ -45,7 +45,7 @@ cond_def()
 
        local val
        val="$(printf %s "$line" |
-               sed -r -n 's/^([^[:space:]]+).*$/\1/p')"
+               LC_ALL=C sed -r -n 's/^([[:alpha:]_][[:alnum:]_]*).*$/\1/p')"
 
        local def
        def="$(printf %s "${line}" |