shithub: mc

Download patch

ref: 066812db79f10a3cdee5268ad7214bacb44d2eef
parent: fcfba8c44c5ee110b7b5fd86d752fdeec33eeb0b
author: Carlin Bingham <[email protected]>
date: Thu Feb 1 21:42:50 EST 2018

Fix std.skipto

It would only skip past however many characters the delimeter was and
would hang if the delimeter wasn't found before eof

--- a/lib/bio/bio.myr
+++ b/lib/bio/bio.myr
@@ -410,6 +410,8 @@
 		| `std.Err `Eof:
 			if !drop
 				ret = readinto(f, ret, f.rend - f.rstart)
+			else
+				f.rstart += f.rend - f.rstart
 			;;
 			if ret.len > 0
 				-> `std.Ok ret
@@ -428,6 +430,8 @@
 				;;
 				if !drop
 					ret = readinto(f, ret, i - f.rstart)
+				else
+					f.rstart += i - f.rstart
 				;;
 				f.rstart += delim.len
 				-> `std.Ok ret
@@ -436,6 +440,8 @@
 		;;
 		if !drop
 			ret = readinto(f, ret, f.rend - f.rstart)
+		else
+			f.rstart += f.rend - f.rstart
 		;;
 	;;
 	std.die("unreachable")