summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7abd711)
raw | patch | inline | side by side (parent: 7abd711)
author | sean <seanlkml@sympatico.ca> | |
Fri, 5 May 2006 13:49:15 +0000 (09:49 -0400) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 5 May 2006 21:33:58 +0000 (14:33 -0700) |
Currently, if the target key has a section that matches
the initial substring of another section we mistakenly
believe we've found the correct section. To avoid this
problem, ensure that the section lengths are identical
before comparison.
Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <junkio@cox.net>
the initial substring of another section we mistakenly
believe we've found the correct section. To avoid this
problem, ensure that the section lengths are identical
before comparison.
Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <junkio@cox.net>
config.c | patch | blob | history |
diff --git a/config.c b/config.c
index 4e1f0c22862b8c8605dbbf3a83ec4e87d9059513..a3e14d76e54e05887545765dabda11b1bc2af748 100644 (file)
--- a/config.c
+++ b/config.c
store.offset[store.seen] = ftell(config_file);
store.state = KEY_SEEN;
store.seen++;
- } else if(!strncmp(key, store.key, store.baselen))
- store.state = SECTION_SEEN;
+ } else if (strrchr(key, '.') - key == store.baselen &&
+ !strncmp(key, store.key, store.baselen))
+ store.state = SECTION_SEEN;
}
return 0;
}