summaryrefslogtreecommitdiff
path: root/Ports/dash/patches/fix-system.patch
blob: 8d95830d86c64d4a63751f52d850c850804efa12 (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
--- dash-0.5.10.2/src/system.c.orig	Sun May 10 01:45:02 2020
+++ dash-0.5.10.2/src/system.c	Sun May 10 01:50:52 2020
@@ -131,64 +131,64 @@
 
 #ifndef HAVE_ISALPHA
 int isalnum(int c) {
-	return _isalnum(c);
+	return (_ctype_[(int)(c)] & (_U | _L | _N));
 }
 
 
 int iscntrl(int c) {
-	return _iscntrl(c);
+	return (_ctype_[(int)(c)] & (_C));
 }
 
 
 int islower(int c) {
-	return _islower(c);
+	return ((_ctype_[(int)(c)] & (_U | _L)) == _L);
 }
 
 
 int isspace(int c) {
-	return _isspace(c);
+	return (_ctype_[(int)(c)] & (_S));
 }
 
 
 int isalpha(int c) {
-	return _isalpha(c);
+	return (_ctype_[(int)(c)] & (_U | _L));
 }
 
 
 int isdigit(int c) {
-	return _isdigit(c);
+	return (_ctype_[(int)(c)] & (_N));
 }
 
 
 int isprint(int c) {
-	return _isprint(c);
+	return (_ctype_[(int)(c)] & (_P | _U | _L | _N | _B));
 }
 
 
 int isupper(int c) {
-	return _isupper(c);
+	return ((_ctype_[(int)(c)] & (_U | _L)) == _U);
 }
 
 
 #if HAVE_DECL_ISBLANK
 int isblank(int c) {
-	return _isblank(c);
+	return (c == ' ' || c == '\t');
 }
 #endif
 
 
 int isgraph(int c) {
-	return _isgraph(c);
+	return (_ctype_[(int)(c)] & (_P | _U | _L | _N));
 }
 
 
 int ispunct(int c) {
-	return _ispunct(c);
+	return (_ctype_[(int)(c)] & (_P));
 }
 
 
 int isxdigit(int c) {
-	return _isxdigit(c);
+	return (_ctype_[(int)(c)] & (_N | _X));
 }
 #endif