From bd211d534bb654bdef9b8c072be0c0d4f24fbf7c Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Fri, 24 Apr 2009 11:45:48 +0000 Subject: We should match the full variable name. --- src/librc/librc-misc.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/librc/librc-misc.c b/src/librc/librc-misc.c index fe6d21ef..73662ecc 100644 --- a/src/librc/librc-misc.c +++ b/src/librc/librc-misc.c @@ -203,14 +203,18 @@ rc_config_value(RC_STRINGLIST *list, const char *entry) { RC_STRING *line; char *p; + size_t len, dif; + len = strlen(entry); TAILQ_FOREACH(line, list, entries) { p = strchr(line->value, '='); - if (p && - strncmp(entry, line->value, (size_t)(p - line->value)) == 0) - return p += 1; + if (p != NULL) { + dif = (p - line->value); + if (dif == len && + strncmp(entry, line->value, dif) == 0) + return ++p; + } } - return NULL; } librc_hidden_def(rc_config_value) -- cgit v1.2.3