=================================================================== RCS file: /cvs/mandoc/soelim.c,v retrieving revision 1.1 retrieving revision 1.6 diff -u -p -r1.1 -r1.6 --- mandoc/soelim.c 2015/05/20 20:55:04 1.1 +++ mandoc/soelim.c 2021/09/19 18:14:24 1.6 @@ -1,4 +1,5 @@ -/*- +/* $Id: soelim.c,v 1.6 2021/09/19 18:14:24 schwarze Exp $ */ +/* * Copyright (c) 2014 Baptiste Daroussin * All rights reserved. * @@ -23,21 +24,24 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "config.h" -#include -__FBSDID("$FreeBSD$"); +#include -#include - -#define _WITH_GETLINE +#include +#if HAVE_ERR +#include +#endif +#include #include -#include #include -#include #include +#if HAVE_STRINGLIST #include -#include -#include +#else +#include "compat_stringlist.h" +#endif +#include #define C_OPTION 0x1 @@ -56,7 +60,7 @@ static FILE * soelim_fopen(const char *name) { FILE *f; - char path[MAXPATHLEN]; + char path[PATH_MAX]; size_t i; if (strcmp(name, "-") == 0) @@ -100,16 +104,16 @@ soelim_file(FILE *f, int flag) } walk = line + 3; - if (!isspace(*walk) && ((flag & C_OPTION) == 0)) { + if (!isspace((unsigned char)*walk) && (flag & C_OPTION) == 0) { printf("%s", line); continue; } - while (isspace(*walk)) + while (isspace((unsigned char)*walk)) walk++; cp = walk; - while (*cp != '\0' && !isspace(*cp)) + while (*cp != '\0' && !isspace((unsigned char)*cp)) cp++; *cp = 0; if (cp < line + linelen)