summaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2009-03-07 13:06:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-03-07 19:22:42 (GMT)
commitc2e9364a06df55e70d7652d37bb4d712f6b3bb3e (patch)
treec9f3d31ccc36e6729434886ee8eea40034c8bf6b /pretty.c
parent3d2d4f96d240317d898bd05af567bad938e0bda2 (diff)
downloadgit-c2e9364a06df55e70d7652d37bb4d712f6b3bb3e.zip
git-c2e9364a06df55e70d7652d37bb4d712f6b3bb3e.tar.gz
git-c2e9364a06df55e70d7652d37bb4d712f6b3bb3e.tar.bz2
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 <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pretty.c')
-rw-r--r--pretty.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/pretty.c b/pretty.c
index 6cd9149..e9540e4 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)