env: Simplify env_match() and inline into env_get_f()
authorMarek Behún <marek.behun@nic.cz>
Sun, 17 Oct 2021 15:36:37 +0000 (17:36 +0200)
committerSimon Glass <sjg@chromium.org>
Thu, 21 Oct 2021 18:50:48 +0000 (12:50 -0600)
commita80652ebb394abfd508feb38090228f5e5290d32
treefa250f890c7569e7ab67e29d170d1e7ca1221b44
parenta473766cce44882237e567bcd58f7559ecdd0440
env: Simplify env_match() and inline into env_get_f()

In the past the env_match() function was used to match envs with
- name, i.e. string "name"
- variable assignment, i.e. string "name=other_value"

The latter is not the case anymore, since the env_match() function is
now used only in env_get_f(), and so we can simplify the function into
a simple strncmp() with an additional comparison to '='.

Let's do this, and since the resulting function is quite simple, let's
also inline its code into env_get_f().

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
cmd/nvedit.c