← Back to index
|
Original Bugzilla link
Bug 1233 – std.string.ifind(char[] s, char[] sub) fails on certain non ascii strings
Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2007-05-15T17:51:00Z
Last change time
2015-06-09T05:15:11Z
Keywords
patch
Assigned to
bugzilla
Creator
d
Comments
Comment #0
by d — 2007-05-15T17:51:03Z
import std.string; int main(char[][] args) { printf("ifind(\"é\", \"é\") -> %d\n", ifind("é", "é")); return 0; } produces incorrect output : ifind("é", "é") -> -1 bug is in src/phobos/std/string.d, line 613: - size_t imax = s.length - sublength; + size_t imax = s.length - sublength + 1; This will fix the bug, but the implementation will remain quite inefficient.
Comment #1
by bugzilla — 2007-07-01T14:02:59Z
Fixed DMD 1.018 and DMD 2.002