Y
Hacker News
new
|
ask
|
show
|
jobs
by
munificent
3657 days ago
That returns a wrong result on Windows paths, and throws an exception on the empty string.
There are a
ton
of edge cases in path manipulation code.
1 comments
kevincox
3657 days ago
I'm pretty sure his implementation works on empty strings because `str[0].nil?`. So the comparison is false, giving the right (?) answer.
link