git: 9front

Download patch

ref: e71e536fab7399969d239d8e96dc8de50007d715
parent: c1dd7b0094702a1055781a2a1e89d69b8539818f
author: cinap_lenrek <cinap_lenrek@centraldogma>
date: Sun Dec 25 19:46:07 EST 2011

9boot: replace strrchr() call with a loop and strchr() for ignoring bang path prefixes

--- a/sys/src/boot/pc/sub.c
+++ b/sys/src/boot/pc/sub.c
@@ -66,17 +66,6 @@
 	return 0;
 }
 
-char*
-strrchr(char *s, int c)
-{
-	char *r = 0;
-
-	while(s = strchr(s, c))
-		r = s++;
-
-	return r;
-}
-
 void
 print(char *s)
 {
@@ -264,7 +253,7 @@
 		print("no bootfile\r\n");
 		goto Loop;
 	}
-	if(p = strrchr(kern, '!'))
+	while(p = strchr(kern, '!'))
 		kern = p+1;
 
 	return kern;
--