Message ID | cover.1700666420.git.petrm@nvidia.com (mailing list archive) |
---|---|
Headers | show |
Series | Change parsing in parse_one_of(), parse_on_off() | expand |
Hello: This series was applied to iproute2/iproute2-next.git (main) by David Ahern <dsahern@kernel.org>: On Wed, 22 Nov 2023 16:23:27 +0100 you wrote: > Library functions parse_one_of() and parse_on_off() were added about three > years ago to unify all the disparate reimplementations of the same basic > idea. It used the matches() function to determine whether a string under > consideration corresponds to one of the keywords. This reflected many, > though not all cases of on/off parsing at the time. > > This decision has some odd consequences. In particular, "o" can be used as > a shorthand for "off", which is not obvious, because "o" is the prefix of > both. By sheer luck, the end result actually makes some sense: "on" means > on, anything else either means off or errors out. Similar issues are in > principle also possible for parse_one_of() uses, though currently this does > not come up. > > [...] Here is the summary with links: - [iproute2-next,v2,1/5] lib: utils: Switch matches() to returning int again https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=60254925ccab - [iproute2-next,v2,2/5] lib: utils: Generalize parse_one_of() https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=256e0ca4b84f - [iproute2-next,v2,3/5] lib: utils: Convert parse_on_off() to strcmp() https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=5ba57152d27c - [iproute2-next,v2,4/5] lib: utils: Introduce parse_one_of_deprecated() https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=2b8766663d3c - [iproute2-next,v2,5/5] lib: utils: Have parse_one_of() warn about prefix matches https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=bd5226437a4c You are awesome, thank you!