# HG changeset patch # User thib # Date 1218026074 0 # Node ID a05bf0823154555044b7e26c53fdb1bc15d82235 # Parent 2e6a92ed913b90aab4e84ee612557b9447fa0a5c Fixes SubStr (RLdev's strsub/strrsub) diff --git a/scn2k/scn2k_cmd.cc b/scn2k/scn2k_cmd.cc --- a/scn2k/scn2k_cmd.cc +++ b/scn2k/scn2k_cmd.cc @@ -423,6 +423,7 @@ bool Flags::Exec(Cmd& cmd) { case 5: // substring, index from left case 6: // substring, index from right // 全角対応らしい + //FIXME: Make sure it works properly { int offset = cmd.args[2].value; int len = strlen(cmd.Str(cmd.args[1])); string str = cmd.Str(cmd.args[1]); @@ -439,7 +440,7 @@ bool Flags::Exec(Cmd& cmd) { if (s[offset_top] == 0) { SetStr(arg1, ""); } else if (cmd.cmd4 == 0) { // 長さ制限なし - SetStr(arg1, string(s, offset_top)); + SetStr(arg1, string(s, offset_top, len-offset_top)); } else { // cmd.cmd4 == 1 int slen = cmd.args[3].value; int offset_end = offset_top;