Package: suckless-tools / 48-1

Define-PATH_MAX-in-case-it-is-missing.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From: Ilias Tsitsimpis <i.tsitsimpis@gmail.com>
Date: Sun, 19 Jun 2016 13:16:49 +0300
Subject: dmenu: Define PATH_MAX in case it is missing

dmenu FTBFS on hurd because the PATH_MAX macro is not defined.
According to POSIX, this macro may not be defined, so fix the code to
not assume otherwise.

For more information, see:
https://www.gnu.org/software/hurd/community/gsoc/project_ideas/maxpath.html

Bug-Debian: https://bugs.debian.org/815357
Forwarded: no
---
 dmenu/stest.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/dmenu/stest.c b/dmenu/stest.c
index e27d3a5..1a75835 100644
--- a/dmenu/stest.c
+++ b/dmenu/stest.c
@@ -13,6 +13,14 @@ char *argv0;
 
 #define FLAG(x)  (flag[(x)-'a'])
 
+/*
+ * PATH_MAX may not be defined.
+ * See https://www.gnu.org/software/hurd/community/gsoc/project_ideas/maxpath.html
+ */
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
 static void test(const char *, const char *);
 static void usage(void);