Fix INSTR

This commit is contained in:
otya128 committed 2016-12-20 21:40:11 +09:00
1 parent a2aa152d5f
commit 4cf742902d
1 file changed
+5 -1
+5 -1
View File
@@ -1228,7 +1228,11 @@ class BuiltinFunction
str1 = vstart.castDString;
str2 = vstr1.castDString;
}
return cast(int)(str1[start..$].indexOf(str2, CaseSensitive.no));
ptrdiff_t index = str1[start..$].indexOf(str2);
if (index == -1)
return -1;
else
return cast(int)(index + start);
}
static int ASC(wstring str)
{