How to get an Express static file server to handle Windows backslashes correctly?

I've written a vanilla server (using Node.js and Express) to browse files and directories (based off the directory middleware). On a Windows machine, it gets confused by the backslashes, and quickly breaks by providing invalid/broken links as you navigate -- links becomes a soup of forward and backslashes, with dir names incorrectly repeated over and over in them, etc.

So or example, going to localhost:8888, clicking on 'lib' folder, then '..', gives me:

/ \lib / \\lib\..\ / 

Here's the code.

var express = require('express');
var server = express();
server.configure(function(){
    server.use(express.static('./stuff'));
    server.use(express.directory('./stuff'));
});
server.listen(8888);

What do I need to do to get this to work on a Windows machine?

@verybadalloc and @user2524973 found a bug in the express directory.js middleware that caused this problem. In the comments to the original question they also provided a fix.

Find the lines that says

return '<li><a href="' + join(dir, file) + '" class="' + classes.join(' ') + '"' + ' title="' + file + '">' 

It should be around line number 176. Change it to:

return '<li><a href="' + join(dir, file).replace(/\\/g, '/') + '" class="' + classes.join(' ') + '"' + ' title="' + file + '">' 

... and it should work better on Windows.

It seems like this fix was added to the main repository, but later removed, so this fix might have some unforeseen consequence? Works for me anyway, I'm just using it to list my music folder.

I posted this answer since I almost missed that they had solved it in the comments. Thanks.