]> granicus.if.org Git - strace/commit
xlat.c: handle NULL xlat in lookup routines as incremental search
authorEugene Syromyatnikov <evgsyr@gmail.com>
Mon, 7 May 2018 05:57:27 +0000 (07:57 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 5 Jun 2018 11:04:09 +0000 (11:04 +0000)
commit3a7d7d8f8c1cb29ee48cede606cd8f8c0c6aa6ab
tree695029fb83dda53046cd518307c3e044c9a969d0
parent9fd42fc53a3197bce9134e854a4cf9e1a008ef3b
xlat.c: handle NULL xlat in lookup routines as incremental search

This is going to be used later in IFLA_AF_SPEC decoding.

* xlat.c (xlookup): Add static variable pos, store xlat there when it is
non-NULL, use pos for lookup.
(xlat_search, xlat_idx): Add static variables pos and memb_left, store
xlat and nmemb there when xlat is non-NULL, use them for lookup.
(printxvals_ex): Store the last non-NULL xlat in static variable "last".
If the first xlat argument is NULL, use "last" instead.

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