Nguyen Thai Ngoc Duy <pclouds@xxxxxxxxx> writes: > 2012/2/4 Junio C Hamano <gitster@xxxxxxxxx>: >> Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> writes: >> >>> - *(int *)opt->value = strtol(arg, (char **)&s, 10); >>> + if (!prefixcmp(arg, "0x") || !prefixcmp(arg, "0X")) >>> + *(int *)opt->value = strtol(arg + 2, (char **)&s, 16); >>> + else >>> + *(int *)opt->value = strtol(arg, (char **)&s, 10); >> >> Can't you just do "strtol(arg, (char **)&s, 0)" instead? > > I could but that means "01234" is now in base 8 and that's currently > accepted as base 10. Yes, but I wonder if that is a problem in practice. Who in the right mind would give 00001000 to tell git that they want one thousand? -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html