diff options
author | Roy Marples <roy@marples.name> | 2009-04-24 11:45:48 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2009-04-24 11:45:48 +0000 |
commit | bd211d534bb654bdef9b8c072be0c0d4f24fbf7c (patch) | |
tree | e539a790e783aa86115f8875239c3c4ae0485e7d /src/librc/librc-misc.c | |
parent | b0ac71fe2aea81ef37a35016630198f38af2d662 (diff) |
We should match the full variable name.
Diffstat (limited to 'src/librc/librc-misc.c')
-rw-r--r-- | src/librc/librc-misc.c | 12 |
1 files 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) |