From 7105a78b17b118866aee77735e26cffcd1fd08fd Mon Sep 17 00:00:00 2001 From: John Keeping Date: Thu, 13 Aug 2015 12:14:19 +0100 Subject: ui-tree: use "sane" isgraph() Git's git-compat-util.h defines a "sane ctype" that does not use locale information and works with signed chars, but it does not include isgraph() so we have included ctype.h ourselves. However, this means we have to include a system header before git-compat-util.h which may lead to the system defining some macros (e.g. _FILE_OFFSET_BITS on Solaris) before git-compat-util.h redefines them with a different value. We cannot include ctype.h after git-compat-util.h because we have defined many of its functions as macros which causes a stream of compilation errors. Defining our own "sane" isgraph() using Git's sane isprint() and isspace() avoids all of these problems. Signed-off-by: John Keeping --- cgit.h | 3 +++ ui-tree.c | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cgit.h b/cgit.h index 508179a..f327627 100644 --- a/cgit.h +++ b/cgit.h @@ -25,6 +25,9 @@ #include #include +/* Add isgraph(x) to Git's sane ctype support (see git-compat-util.h) */ +#undef isgraph +#define isgraph(x) (isprint((x)) && !isspace((x))) /* * Dateformats used on misc. pages diff --git a/ui-tree.c b/ui-tree.c index c8d24f6..2dbe89e 100644 --- a/ui-tree.c +++ b/ui-tree.c @@ -6,7 +6,6 @@ * (see COPYING for full license text) */ -#include #include "cgit.h" #include "ui-tree.h" #include "html.h" -- cgit 1.4.1 ='qt'>
Commit message (Expand)Author
2017-08-19Move nethack options to envJune McEnroe
2017-08-17Remove scala syntax fileJune McEnroe
2017-08-06Add wakeJune McEnroe
2017-08-04Use $() in install.shJune McEnroe
2017-08-02Create Code Tarmak 3 layoutJune McEnroe
2017-07-31Add tupJune McEnroe
2017-07-31Use designated initializer for hnel tableJune McEnroe
2017-07-30Add juneJune McEnroe
2017-07-30Play nethack as ValkyrieJune McEnroe
2017-07-28Add toggle to hnelJune McEnroe
2017-07-28Install slJune McEnroe
2017-07-25Add up, supJune McEnroe
2017-07-24Autopickup ringsJune McEnroe
2017-07-24Name dogJune McEnroe
2017-07-23Add nethackrcJune McEnroe
2017-07-23Remove useless setuid in briJune McEnroe
2017-07-23Clean up hnel a tiny bitJune McEnroe
2017-07-21Set window size in hnelJune McEnroe
2017-07-21Add hnelJune McEnroe
2017-07-19chmod 600 in dtchJune McEnroe