digitalmars.D.bugs - std.string.replace in 0.133
- Steve Adams (9/9) Sep 27 2005 This works in prior releases. When compiled and run with dmd -w, this
- =?ISO-8859-1?Q?Thomas_K=FChne?= (16/27) Sep 27 2005 -----BEGIN PGP SIGNED MESSAGE-----
- Derek Parnell (11/37) Sep 27 2005 Could that 'fix' also be
This works in prior releases. When compiled and run with dmd -w, this causes an access violation. import std.string; int main() { // change " YYY" to " YYY" and it runs char[] s = replace( std.string.toupper( "xxx" ), " YYY", "" ); return( 0 ); }
Sep 27 2005
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Steve Adams schrieb:This works in prior releases. When compiled and run with dmd -w, this causes an access violation. import std.string; int main() { // change " YYY" to " YYY" and it runs char[] s = replace( std.string.toupper( "xxx" ), " YYY", "" ); return( 0 ); }FIX: std/string.d -> ifind (line 596) from: to: Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFDOb4o3w+/yD4P9tIRAgvVAJ4kc9JyD/oOrlL7VHMV0BdnimJWtACgxjMf V1k9K7avq/oapznSPz+LQcs= =t75a -----END PGP SIGNATURE-----
Sep 27 2005
On Tue, 27 Sep 2005 23:48:24 +0200, Thomas Kühne wrote:-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Steve Adams schrieb:Could that 'fix' also be if (sublength > s.length) return -1; on basis that if the substring is longer than the string, then the string cannot contain the substring. -- Derek (skype: derek.j.parnell) Melbourne, Australia 28/09/2005 8:44:34 AMThis works in prior releases. When compiled and run with dmd -w, this causes an access violation. import std.string; int main() { // change " YYY" to " YYY" and it runs char[] s = replace( std.string.toupper( "xxx" ), " YYY", "" ); return( 0 ); }FIX: std/string.d -> ifind (line 596) from: to:
Sep 27 2005