From 694f4736dfe9f1ac77164321cfbb2a9e62b9836b Mon Sep 17 00:00:00 2001 From: otya128 Date: Sat, 24 Dec 2016 16:20:16 +0900 Subject: [PATCH] Fix RIGHT$ --- SMILEBASIC/builtinfunctions.d | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SMILEBASIC/builtinfunctions.d b/SMILEBASIC/builtinfunctions.d index 91d45f9..05c65e8 100644 --- a/SMILEBASIC/builtinfunctions.d +++ b/SMILEBASIC/builtinfunctions.d @@ -1226,12 +1226,16 @@ class BuiltinFunction { if (len >= str.length) { - return str[0..$]; + return str; } return str[0..len]; } static wstring RIGHT(wstring str, int len) { + if (len >= str.length) + { + return str; + } return str[$ - len..$]; } static wstring SUBST(wstring str, int i, Value alen, DefaultValue!(Value,false) areplace)