From c2e9364a06df55e70d7652d37bb4d712f6b3bb3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sat, 7 Mar 2009 14:06:49 +0100 Subject: cleanup: add isascii() Add a standard definition of isascii() and use it to replace an open coded high-bit test in pretty.c. While we're there, write the ESC char as the more commonly used '\033' instead of as 0x1b to enhance its grepability. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- pretty.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'pretty.c') diff --git a/pretty.c b/pretty.c index 6cd91491d..e9540e46d 100644 --- a/pretty.c +++ b/pretty.c @@ -75,8 +75,7 @@ static int get_one_line(const char *msg) /* High bit set, or ISO-2022-INT */ int non_ascii(int ch) { - ch = (ch & 0xff); - return ((ch & 0x80) || (ch == 0x1b)); + return !isascii(ch) || ch == '\033'; } static int is_rfc2047_special(char ch) -- cgit v1.2.1