From: René Scharfe Date: Sat, 22 Feb 2020 18:51:13 +0000 (+0100) Subject: quote: use isalnum() to check for alphanumeric characters X-Git-Tag: v2.26.0-rc0~18^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2b3c430bcea5d8c40b218c7e2a71d261822c6a52;p=thirdparty%2Fgit.git quote: use isalnum() to check for alphanumeric characters isalnum(c) is equivalent to isalpha(c) || isdigit(c), so use the former instead. The result is shorter, simpler and slightly more efficient. Signed-off-by: René Scharfe Signed-off-by: Junio C Hamano --- diff --git a/quote.c b/quote.c index 24a58ba454..bcc0dbc50d 100644 --- a/quote.c +++ b/quote.c @@ -55,7 +55,7 @@ void sq_quote_buf_pretty(struct strbuf *dst, const char *src) } for (p = src; *p; p++) { - if (!isalpha(*p) && !isdigit(*p) && !strchr(ok_punct, *p)) { + if (!isalnum(*p) && !strchr(ok_punct, *p)) { sq_quote_buf(dst, src); return; }