]> git.cameronkatri.com Git - mandoc.git/blobdiff - soelim.c
Reduce the amount of code by moving the three copies of the ohash
[mandoc.git] / soelim.c
index de6911f3c83c8840fd23359acc3cb64417fa3fe7..9a7d32597f81347a167da8bed8237e485b1f0d5a 100644 (file)
--- a/soelim.c
+++ b/soelim.c
@@ -1,4 +1,5 @@
-/*-
+/*     $Id: soelim.c,v 1.4 2015/05/21 00:18:52 schwarze Exp $  */
+/*
  * Copyright (c) 2014 Baptiste Daroussin <bapt@FreeBSD.org>
  * All rights reserved.
  *
  * (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 <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+#include <sys/types.h>
 
-#include <sys/param.h>
-
-#define _WITH_GETLINE
+#include <ctype.h>
+#include <err.h>
+#include <limits.h>
 #include <stdio.h>
-#include <unistd.h>
 #include <stdlib.h>
-#include <stdbool.h>
 #include <string.h>
+#if HAVE_STRINGLIST
 #include <stringlist.h>
-#include <err.h>
-#include <ctype.h>
+#else
+#include "compat_stringlist.h"
+#endif
+#include <unistd.h>
 
 #define C_OPTION 0x1
 
@@ -56,7 +58,7 @@ static FILE *
 soelim_fopen(const char *name)
 {
        FILE *f;
-       char path[MAXPATHLEN];
+       char path[PATH_MAX];
        size_t i;
 
        if (strcmp(name, "-") == 0)