{"thread":{"id":"4080","subject":"[PATCH] Another config file parsing fix.","startedAt":"2006-05-06T18:14:02Z","lastAt":"2006-05-06T18:14:02Z","messageCount":1,"participants":["sean"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"19610","messageId":"BAYC1-PASMTP050DC939D9D702CA1B3208AEAA0@CEZ.ICE","threadId":"4080","inReplyTo":null,"subject":"[PATCH] Another config file parsing fix.","fromName":"sean","fromEmail":"seanlkml@sympatico.ca","sentAt":"2006-05-06T18:14:02Z","receivedAt":"2006-05-06T18:14:02Z","isPatch":true,"sender":{"key":"seanlkml@sympatico.ca","avatar":"https://gravatar.com/avatar/f92923f54fc08c401fc59b71829d4b89e9b8087fbba45ff87c82e6a83aee02ae?d=mp&s=160"},"body":"If the variable we need to store should go into a section\nthat currently only has a single variable (not matching\nthe one we're trying to insert), we will already be into\nthe next section before we notice we've bypassed the correct\nlocation to insert the variable.\n\nTo handle this case we store the current location as soon\nas we find a variable matching the section of our new\nvariable.\n\nSigned-off-by: Sean Estabrooks <seanlkml@sympatico.ca>\n\n\n---\n\n config.c |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\n1ba487db7393d773a2a4b7c404ba1b807272eb7d\ndiff --git a/config.c b/config.c\nindex 87fb220..41066e4 100644\n--- a/config.c\n+++ b/config.c\n@@ -336,8 +336,10 @@ static int store_aux(const char* key, co\n \t\t\tstore.state = KEY_SEEN;\n \t\t\tstore.seen++;\n \t\t} else if (strrchr(key, '.') - key == store.baselen &&\n-\t\t\t      !strncmp(key, store.key, store.baselen))\n+\t\t\t      !strncmp(key, store.key, store.baselen)) {\n \t\t\t\t\tstore.state = SECTION_SEEN;\n+\t\t\t\t\tstore.offset[store.seen] = ftell(config_file);\n+\t\t}\n \t}\n \treturn 0;\n }\n-- \n1.3.2.g6e99a-dirty\n"}]}