=================================================================== RCS file: /cvs/mandoc/mandocdb.c,v retrieving revision 1.49.2.6 retrieving revision 1.49.2.10 diff -u -p -r1.49.2.6 -r1.49.2.10 --- mandoc/mandocdb.c 2013/10/01 00:52:58 1.49.2.6 +++ mandoc/mandocdb.c 2013/11/21 01:53:48 1.49.2.10 @@ -1,4 +1,4 @@ -/* $Id: mandocdb.c,v 1.49.2.6 2013/10/01 00:52:58 schwarze Exp $ */ +/* $Id: mandocdb.c,v 1.49.2.10 2013/11/21 01:53:48 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2011, 2012 Ingo Schwarze @@ -34,20 +34,23 @@ #include #include -#if defined(__linux__) || defined(__sun) +#if defined(__APPLE__) +# include +#elif defined(__linux__) # include +#elif defined(__sun) +# include +# include +#else +# include +#endif + +#if defined(__linux__) || defined(__sun) # include -#elif defined(__APPLE__) -# include -# include #else # include #endif -#if defined(__sun) -#include -#endif - #include "man.h" #include "mdoc.h" #include "mandoc.h" @@ -619,6 +622,8 @@ index_merge(const struct of *of, struct mparse *mp, uint64_t vbuf[2]; char type; + static char emptystring[] = ""; + if (warnings) { files = NULL; hash_reset(&files); @@ -731,13 +736,13 @@ index_merge(const struct of *of, struct mparse *mp, } buf_appendb(buf, ")", 2); for (p = buf->cp; '\0' != *p; p++) - *p = tolower(*p); + *p = tolower((unsigned char)*p); key.data = buf->cp; key.size = buf->len; val.data = NULL; val.size = 0; if (0 == skip) - val.data = ""; + val.data = emptystring; else { ch = (*files->get)(files, &key, &val, 0); if (ch < 0) {