git-rev-parse: Fix --short= option parsing

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
This commit is contained in:
Jonas Fonseca
2006-02-18 02:10:53 +01:00
committed by Junio C Hamano
parent b5b16990f8
commit 44de0da4f9

View File

@ -225,12 +225,12 @@ int main(int argc, char **argv)
continue; continue;
} }
if (!strcmp(arg, "--short") || if (!strcmp(arg, "--short") ||
!strncmp(arg, "--short=", 9)) { !strncmp(arg, "--short=", 8)) {
filter &= ~(DO_FLAGS|DO_NOREV); filter &= ~(DO_FLAGS|DO_NOREV);
verify = 1; verify = 1;
abbrev = DEFAULT_ABBREV; abbrev = DEFAULT_ABBREV;
if (arg[8] == '=') if (arg[7] == '=')
abbrev = strtoul(arg + 9, NULL, 10); abbrev = strtoul(arg + 8, NULL, 10);
if (abbrev < MINIMUM_ABBREV) if (abbrev < MINIMUM_ABBREV)
abbrev = MINIMUM_ABBREV; abbrev = MINIMUM_ABBREV;
else if (40 <= abbrev) else if (40 <= abbrev)