=================================================================== RCS file: /cvs/mandoc/mandocdb.c,v retrieving revision 1.49.2.7 retrieving revision 1.49.2.10 diff -u -p -r1.49.2.7 -r1.49.2.10 --- mandoc/mandocdb.c 2013/10/02 21:03:26 1.49.2.7 +++ mandoc/mandocdb.c 2013/11/21 01:53:48 1.49.2.10 @@ -1,4 +1,4 @@ -/* $Id: mandocdb.c,v 1.49.2.7 2013/10/02 21:03:26 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,19 +34,21 @@ #include #include -#if defined(__linux__) || defined(__sun) -# include -# include -#elif defined(__APPLE__) +#if defined(__APPLE__) # include -# include +#elif defined(__linux__) +# include +#elif defined(__sun) +# include +# include #else # include -# include #endif -#if defined(__sun) -#include +#if defined(__linux__) || defined(__sun) +# include +#else +# include #endif #include "man.h" @@ -620,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); @@ -732,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) {