Thanks Robin. Actually I had made a few fixes in the string functions,
including this one, in the working version; as far as I can tell, the
translate problem mentioned by Nicolas also appears fixed.
Making a patch for just this thing would be a bit difficult as there are
many other changes; a new release will appear soon but if anyone's in a
rush, we can release another patch to 0.44.
Tom
[EMAIL PROTECTED] wrote:
>
> I *think* this fixes the problem reported earlier.
>
> .robin.
>
> --- expr.cpp.orig Tue Nov 14 15:09:04 2000
> +++ expr.cpp Tue Nov 14 15:53:22 2000
> @@ -1553,18 +1553,6 @@
> return "";
> }
>
> -char *Expression::tostringCharPtr()
> -{
> - assert((functor == EXF_ATOM) && (type == EX_STRING));
> - return (char*)(*NZ(patomstring));
> -}
> -
> -const Str& Expression::tostringRef() const
> -{
> - assert((functor == EXF_ATOM) && (type == EX_STRING));
> - return (*NZ(patomstring));
> -}
> -
> Number Expression::tonumber()
> {
> assert(functor == EXF_ATOM);
> @@ -2692,14 +2680,16 @@
> case EXFF_SUBSTRING_AFTER:
> {
> Str s;
> - const Str& theSmaller = atoms[1] -> tostringRef();
> - char *thestring;
> + Str theSmaller;
> + Str thestring;
> +
> checkArgsCount(2);
> checkIsString2(0,1);
> int where = firstOccurence(
> // changing tostringCharPtr() to tostring():
> - thestring = atoms[0] -> tostring(),
> - theSmaller);
> + thestring = atoms[0] -> tostring(),
> + theSmaller = atoms[1] -> tostring());
> +
> if (where == -1)
> s.empty();
> else