mirror of
https://github.com/moparisthebest/hexchat
synced 2024-12-22 23:58:52 -05:00
fix cfgfiles bug when variable names include each other
This commit is contained in:
parent
455032938a
commit
a3a6346fec
@ -164,9 +164,13 @@ list_delentry (GSList ** list, char *name)
|
|||||||
char *
|
char *
|
||||||
cfg_get_str (char *cfg, char *var, char *dest, int dest_len)
|
cfg_get_str (char *cfg, char *var, char *dest, int dest_len)
|
||||||
{
|
{
|
||||||
|
char buffer[128]; /* should be plenty for a variable name */
|
||||||
|
|
||||||
|
sprintf (buffer, "%s ", var); /* add one space, this way it works against var - var2 checks too */
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
if (!strncasecmp (var, cfg, strlen (var)))
|
if (!strncasecmp (buffer, cfg, strlen (var) + 1))
|
||||||
{
|
{
|
||||||
char *value, t;
|
char *value, t;
|
||||||
cfg += strlen (var);
|
cfg += strlen (var);
|
||||||
|
Loading…
Reference in New Issue
Block a user