From: Roy Marples Date: Tue, 7 Feb 2023 16:39:27 +0000 (+0000) Subject: options: Match exact string for environment changes X-Git-Tag: v9.5.0~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f03307bed9bb233054cc6cd8caa01297dca1a49;p=thirdparty%2Fdhcpcd.git options: Match exact string for environment changes So that domain_name doesn't overwrite domain_name_servers. Fixes #184. --- diff --git a/src/if-options.c b/src/if-options.c index ae0f8826..b1a4c3c5 100644 --- a/src/if-options.c +++ b/src/if-options.c @@ -190,10 +190,9 @@ add_environ(char ***array, const char *value, int uniq) return NULL; } *p++ = '\0'; - l = strlen(match); while (list && list[i]) { - if (match && strncmp(list[i], match, l) == 0) { + if (match && strcmp(list[i], match) == 0) { if (uniq) { n = strdup(value); if (n == NULL) {