summaryrefslogtreecommitdiff
path: root/editors/mg/patches/patch-af
blob: 47f91f39e1b9b415b4883210f0e0c458aac60f43 (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
$NetBSD: patch-af,v 1.3 2014/07/07 18:06:58 jperkin Exp $

Include limits.h for INT_{MIN,MAX}

--- grep.c.orig	2011-01-02 22:57:56.000000000 +0000
+++ grep.c
@@ -8,6 +8,7 @@
 
 #include <sys/types.h>
 #include <ctype.h>
+#include <limits.h>
 
 #include "libgen.h"
 
@@ -152,7 +153,7 @@ gid(int f, int n)
 	/* Skip backwards over delimiters we are currently on */
 	while (i > 0) {
 		c = lgetc(curwp->w_dotp, i);
-		if (isalnum(c) || c == '_')
+		if (isalnum((unsigned char)c) || c == '_')
 			break;
 
 		i--;
@@ -161,14 +162,14 @@ gid(int f, int n)
 	/* Skip the symbol itself */
 	for (; i > 0; i--) {
 		c = lgetc(curwp->w_dotp, i - 1);
-		if (!isalnum(c) && c != '_')
+		if (!isalnum((unsigned char)c) && c != '_')
 			break;
 	}
 	/* Fill the symbol in cprompt[] */
 	for (j = 0; j < sizeof(cprompt) - 1 && i < llength(curwp->w_dotp);
 	    j++, i++) {
 		c = lgetc(curwp->w_dotp, i);
-		if (!isalnum(c) && c != '_')
+		if (!isalnum((unsigned char)c) && c != '_')
 			break;
 		cprompt[j] = c;
 	}