summaryrefslogtreecommitdiffstats
path: root/src/readline-1.patch
blob: c23e8763c32163386173adffb53b7e117468d4f9 (plain)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
This file is part of MXE. See LICENSE.md for licensing information.

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
Date: Tue, 30 Sep 2014 17:16:32 -0700
Subject: [PATCH 1/1] Handle missing S_IS* macros more gracefully


diff --git a/colors.c b/colors.c
index 1111111..2222222 100644
--- a/colors.c
+++ b/colors.c
@@ -200,8 +200,10 @@ _rl_print_color_indicator (const char *f)
 #endif
           if (is_colored (C_CAP) && 0) //f->has_capability)
             colored_filetype = C_CAP;
+#if defined(S_IXUGO)
           else if ((mode & S_IXUGO) != 0 && is_colored (C_EXEC))
             colored_filetype = C_EXEC;
+#endif
           else if ((1 < astat.st_nlink) && is_colored (C_MULTIHARDLINK))
             colored_filetype = C_MULTIHARDLINK;
         }
@@ -215,8 +217,10 @@ _rl_print_color_indicator (const char *f)
             colored_filetype = C_STICKY_OTHER_WRITABLE;
           else
 #endif
+#if defined (S_IWOTH)
           if ((mode & S_IWOTH) != 0 && is_colored (C_OTHER_WRITABLE))
             colored_filetype = C_OTHER_WRITABLE;
+#endif
 #if defined (S_ISVTX)
           else if ((mode & S_ISVTX) != 0 && is_colored (C_STICKY))
             colored_filetype = C_STICKY;
diff --git a/colors.h b/colors.h
index 1111111..2222222 100644
--- a/colors.h
+++ b/colors.h
@@ -96,7 +96,7 @@ enum indicator_no
   };
 
 
-#if !S_IXUGO
+#if !S_IXUGO && defined(S_IXUSR) && defined(S_IXGRP) && defined(S_IXOTH)
 # define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH)
 #endif
 
diff --git a/posixstat.h b/posixstat.h
index 1111111..2222222 100644
--- a/posixstat.h
+++ b/posixstat.h
@@ -78,30 +78,44 @@
 
 #if defined (S_IFBLK) && !defined (S_ISBLK)
 #define	S_ISBLK(m)	(((m)&S_IFMT) == S_IFBLK)	/* block device */
+#elif !defined (S_IFBLK)
+#define S_ISBLK(m)	0
 #endif
 
 #if defined (S_IFCHR) && !defined (S_ISCHR)
 #define	S_ISCHR(m)	(((m)&S_IFMT) == S_IFCHR)	/* character device */
+#elif !defined (S_IFCHR)
+#define S_ISCHR(m)	0
 #endif
 
 #if defined (S_IFDIR) && !defined (S_ISDIR)
 #define	S_ISDIR(m)	(((m)&S_IFMT) == S_IFDIR)	/* directory */
+#elif !defined (S_IFDIR)
+#define S_ISDIR(m)	0
 #endif
 
 #if defined (S_IFREG) && !defined (S_ISREG)
 #define	S_ISREG(m)	(((m)&S_IFMT) == S_IFREG)	/* file */
+#elif !defined (S_IFREG)
+#define S_ISREG(m)	0
 #endif
 
 #if defined (S_IFIFO) && !defined (S_ISFIFO)
 #define	S_ISFIFO(m)	(((m)&S_IFMT) == S_IFIFO)	/* fifo - named pipe */
+#elif !defined (S_IFIFO)
+#define S_ISFIFO(m)	0
 #endif
 
 #if defined (S_IFLNK) && !defined (S_ISLNK)
 #define	S_ISLNK(m)	(((m)&S_IFMT) == S_IFLNK)	/* symbolic link */
+#elif !defined (S_IFLNK)
+#define S_ISLNK(m)	0
 #endif
 
 #if defined (S_IFSOCK) && !defined (S_ISSOCK)
 #define	S_ISSOCK(m)	(((m)&S_IFMT) == S_IFSOCK)	/* socket */
+#elif !defined (S_IFSOCK)
+#define S_ISSOCK(m)	0
 #endif
 
 /*
@@ -137,6 +151,8 @@
 /* These are non-standard, but are used in builtins.c$symbolic_umask() */
 #define S_IRUGO		(S_IRUSR | S_IRGRP | S_IROTH)
 #define S_IWUGO		(S_IWUSR | S_IWGRP | S_IWOTH)
+#if defined(S_IXUSR) && defined(S_IXGRP) && defined(S_IXOTH)
 #define S_IXUGO		(S_IXUSR | S_IXGRP | S_IXOTH)
+#endif
 
 #endif /* _POSIXSTAT_H_ */