3 ms·
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.
by munificent 10y 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.
- kevincox 10y agoI'm pretty sure his implementation works on empty strings because `str[0].nil?`. So the comparison is false, giving the right (?) answer.