aboutsummaryrefslogtreecommitdiff
path: root/shells/v7sh/files/patch-string.c
blob: ee333b2f0e353de46364634b64cefefa0cc2c06a (plain) (blame)
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
diff -u -x CVS -x work -x core -x *.core -x #* -x *~ -x *.orig -x *.rej -I $Id.*$ -I $.+BSD.*$ string.c.orig string.c
--- string.c.orig	Fri Jun  4 02:51:02 2004
+++ string.c	Sat Jun 19 18:42:24 2004
@@ -14,19 +14,20 @@
 
 
 STRING	movstr(a,b)
-	REG STRING	a, b;
+	REG CSTRING	a;
+	REG STRING	b;
 {
-	WHILE *b++ = *a++ DONE
+	WHILE (*b++ = *a++)!=0 DONE		/* GCC */
 	return(--b);
 }
 
 INT	any(c,s)
-	REG CHAR	c;
-	STRING		s;
+	REG INT		c;
+	CSTRING		s;
 {
-	REG CHAR d;
+	REG INT		d;
 
-	WHILE d = *s++
+	WHILE (d = *s++)!=0			/* GCC */
 	DO	IF d==c
 		THEN	return(TRUE);
 		FI
@@ -35,7 +36,7 @@
 }
 
 INT	cf(s1, s2)
-	REG STRING s1, s2;
+	REG CSTRING s1, s2;
 {
 	WHILE *s1++ == *s2
 	DO	IF *s2++==0
@@ -46,10 +47,10 @@
 }
 
 INT	length(as)
-	STRING as;
+	CSTRING as;
 {
-	REG STRING s;
+	REG CSTRING s;
 
-	IF s=as THEN WHILE *s++ DONE FI
+	IF (s=as)!=NIL THEN WHILE *s++ DONE FI	/* GCC */
 	return(s-as);
 }