shithub: riscv

Download patch

ref: 7d18756b39cc33482f8cf5574b20a51331c4cea3
parent: 84351ae4cb50857fe62e0938198db0c7ea33d05c
author: qwx <devnull@localhost>
date: Sat Mar 31 07:38:09 EDT 2018

gb*: reverse savegame field polarity

--- a/sys/src/games/gb/gb.c
+++ b/sys/src/games/gb/gb.c
@@ -99,7 +99,7 @@
 
 	buf = emalloc(strlen(file) + 4);
 	strcpy(buf, file);
-	p = strchr(buf, '.');
+	p = strrchr(buf, '.');
 	if(p == nil)
 		p = buf + strlen(buf);
 	strcpy(p, ".sav");
--- a/sys/src/games/gba/gba.c
+++ b/sys/src/games/gba/gba.c
@@ -145,7 +145,7 @@
 	
 	buf = emalloc(strlen(file) + 4);
 	strcpy(buf, file);
-	p = strchr(buf, '.');
+	p = strrchr(buf, '.');
 	if(p == nil)
 		p = buf + strlen(buf);
 	strcpy(p, ".sav");