nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
acc18ca
)
lib/text: `FlatString::substring` returns "" on count == 0 or less
author
Alexis Laferrière
<alexis.laf@xymus.net>
Mon, 15 Feb 2016 20:12:06 +0000
(15:12 -0500)
committer
Alexis Laferrière
<alexis.laf@xymus.net>
Mon, 15 Feb 2016 20:17:55 +0000
(15:17 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib/core/text/flat.nit
patch
|
blob
|
history
diff --git
a/lib/core/text/flat.nit
b/lib/core/text/flat.nit
index
9a70db8
..
47b8608
100644
(file)
--- a/
lib/core/text/flat.nit
+++ b/
lib/core/text/flat.nit
@@
-370,7
+370,7
@@
class FlatString
redef fun substring(from, count)
do
- assert count >= 0
+ if count <= 0 then return ""
if from < 0 then
count += from