From 7833357e3639af72a2bd8d4679fce3c4d66af0a9 Mon Sep 17 00:00:00 2001
From: Lev Kujawski <int21h@mailbox.org>
Date: Wed, 6 Jan 2021 12:27:28 -0700
Subject: [PATCH 2/8] The musl C library does not define MAXNAMLEN, but we can
 use the POSIX alternative, NAME_MAX, instead.

---
 cde/programs/dtdocbook/instant/main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/cde/programs/dtdocbook/instant/main.c b/cde/programs/dtdocbook/instant/main.c
index 2b479d74..8a3f316a 100644
--- a/cde/programs/dtdocbook/instant/main.c
+++ b/cde/programs/dtdocbook/instant/main.c
@@ -70,6 +70,7 @@ static char *CopyRt =
 #include <stdlib.h>
 #include <ctype.h>
 #include <string.h>
+#include <limits.h>
 #include <memory.h>
 #include <errno.h>
 #include <sys/types.h>
@@ -89,8 +90,12 @@ static char *CopyRt =
 
 /* for backwards compatibility */
 #ifndef _MAXNAMLEN
+#ifndef MAXNAMLEN
+#define _MAXNAMLEN NAME_MAX
+#else
 #define _MAXNAMLEN MAXNAMLEN
 #endif
+#endif
 
 static int	do_context, do_tree, do_summ, do_stats, do_validate, do_idlist;
 static char	*this_prog;
-- 
2.30.0

