提交 437ed4ce 编写于 作者: J Junio C Hamano

Merge branch 'rs/use-isxdigit' into maint

Code cleanup.

* rs/use-isxdigit:
  use isxdigit() for checking if a character is a hexadecimal digit
......@@ -757,7 +757,7 @@ static int get_describe_name(const char *name, int len, unsigned char *sha1)
for (cp = name + len - 1; name + 2 <= cp; cp--) {
char ch = *cp;
if (hexval(ch) & ~0377) {
if (!isxdigit(ch)) {
/* We must be looking at g in "SOMETHING-g"
* for it to be describe output.
*/
......
......@@ -117,7 +117,7 @@ static void insert_packed_refs(const char *packed_refs, struct ref **list)
return;
}
if (hexval(buffer[0]) > 0xf)
if (!isxdigit(buffer[0]))
continue;
len = strlen(buffer);
if (len && buffer[len - 1] == '\n')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册