{"thread":{"id":"5379","subject":"[PATCH] describe: fix off-by-one error in --abbrev=40 handling","startedAt":"2006-08-25T00:48:04Z","lastAt":"2006-08-25T00:48:04Z","messageCount":1,"participants":["Jonas Fonseca"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"25873","messageId":"20060825004804.GA4069@diku.dk","threadId":"5379","inReplyTo":null,"subject":"[PATCH] describe: fix off-by-one error in --abbrev=40 handling","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2006-08-25T00:48:04Z","receivedAt":"2006-08-25T00:48:04Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Signed-off-by: Jonas Fonseca <fonseca@diku.dk>\n---\n\nPossible stupid fix, but shouldn't one be able to say --abbrev=40 if only\nonce in a life time?\n\n describe.c |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/describe.c b/describe.c\nindex 2b9301f..5dd8b2e 100644\n--- a/describe.c\n+++ b/describe.c\n@@ -42,7 +42,7 @@ static void add_to_known_names(const cha\n \tstruct commit_name *name = xmalloc(sizeof(struct commit_name) + len);\n \n \tname->commit = commit;\n-\tname->prio = prio; \n+\tname->prio = prio;\n \tmemcpy(name->path, path, len);\n \tidx = names;\n \tif (idx >= allocs) {\n@@ -154,7 +154,7 @@ int main(int argc, char **argv)\n \t\t\ttags = 1;\n \t\telse if (!strncmp(arg, \"--abbrev=\", 9)) {\n \t\t\tabbrev = strtoul(arg + 9, NULL, 10);\n-\t\t\tif (abbrev < MINIMUM_ABBREV || 40 <= abbrev)\n+\t\t\tif (abbrev < MINIMUM_ABBREV || 40 < abbrev)\n \t\t\t\tabbrev = DEFAULT_ABBREV;\n \t\t}\n \t\telse\n\n-- \nJonas Fonseca\n"}]}