fixing multiple / in paths
[nodejs-repoproxy.git] / lib / maintain.js
index cd8ea8b..6ae0429 100644 (file)
@@ -89,7 +89,7 @@ function walkDir(dir, done) {
                (function next() {
                        var file = list[i++];
                        if (!file) return done(null, results);
-                       file = path.normalize(dir + "/" + file);
+                       file = path.normalize(dir + "/" + file).replace(/\/+/g, "/");
                        fs.stat(file, function(err, stat) {
                                if (stat && stat.isDirectory()) {
                                        walkDir(file, function(err, res) {