Ticket #8188: cmi-talk-regression-fix.diff

File cmi-talk-regression-fix.diff, 928 bytes (added by eriktorbjorn, 17 years ago)

Patch against a March 11 CVS snapshot

  • scummvm/scumm/string.cpp

    diff -ur ScummVM-cvs20030311/scummvm/scumm/string.cpp ScummVM-cvs20030311+hack/scummvm/scumm/string.cpp
    old new  
    970970                }
    971971        }
    972972
     973        // If the string has a translation ID but no translation was found,
     974        // fall back on the untranslated string.
     975
    973976        if (text[0] == '/') {
    974977                byte *pointer = (byte *)strchr((char *)text + 1, '/');
    975978                if (pointer != NULL) {
    976979                        pointer++;
    977                         int l = 0;
    978                         while (*pointer != '/' && *pointer != 0xff && *pointer != 0) {
    979                                 trans_buff[l++] = *pointer++;
    980                         }
    981                         trans_buff[l] = '\0';
     980                        memcpy(trans_buff, pointer, resStrLen(pointer) + 1);
     981                        return;
    982982                }
    983                 else
    984                         trans_buff[0] = '\0';
    985                 return;
    986983        }
    987984
     985        // As a last resort, use the original string.
     986
    988987        memcpy(trans_buff, text, resStrLen(text) + 1);
    989988}
    990989