shithub: mc

Download patch

ref: e1f7ee14e89c4d5219245bdb3e917cbca48b4a04
parent: acb375efc5fc5c7e52f12e48dcf7e0410e68f5e7
author: Ori Bernstein <[email protected]>
date: Tue Sep 16 22:09:41 EDT 2014

Add support for relative cutoffs.

--- a/libstd/floatfmt.myr
+++ b/libstd/floatfmt.myr
@@ -113,10 +113,12 @@
 				bigfree(u)
 			;;
 		;;
-		match mode
-		| 0:
+		if mode == 0
 			cutoff = k - buf.len - 1
-		| 1:
+		else
+			if mode == 2
+				cutoff += k
+			;;
 			a = cutoff - k
 			y = bigdup(s)
 			if a < 0
@@ -139,9 +141,9 @@
 			| `Before:	/* nothing */
 			| _:
 				bigfree(mp)
-				mm = y
+				mp = y
+				roundup = true
 			;;
-		| 2:
 		;;
 		u = bigdup(s)
 		bigshli(u, 1)