From 2840651540d0f54987724544ad0ca2d5de387a7e Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Fri, 29 Aug 2014 15:45:34 -0400 Subject: [PATCH] lib/standard/string: Proper handling of trivial cases in substring_from. Signed-off-by: Lucas Bajolet --- lib/standard/string.nit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/standard/string.nit b/lib/standard/string.nit index 821672e..22c32e8 100644 --- a/lib/standard/string.nit +++ b/lib/standard/string.nit @@ -178,7 +178,7 @@ abstract class Text # As with substring, a `from` index < 0 will be replaced by 0 fun substring_from(from: Int): SELFTYPE do - if from > self.length then return empty + if from >= self.length then return empty if from < 0 then from = 0 return substring(from, length - from) end -- 1.7.9.5