From: Roy Marples Date: Tue, 7 Feb 2023 16:39:27 +0000 (+0000) Subject: options: Match exact string for environment changes X-Git-Tag: v10.0.0~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73edae310bab989d9ec34be85a8c86353c7f7095;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 721c762c..fdb50706 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) {