Skip to content

Commit

Permalink
Add a call to path.normalize, just to be safe
Browse files Browse the repository at this point in the history
  • Loading branch information
holatuwol committed Aug 15, 2019
1 parent 41bdd22 commit 3ec9147
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions streams2/streams2.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ var path = require('path');

function getFilePath(folderPath, fileName) {
if (folderPath == '.') {
return fileName;
return path.normalize(fileName);
}
else if (!folderPath || !fileName) {
return undefined;
}
else {
return path.join(folderPath, fileName).replace(/\\/g, '/');
return path.normalize(path.join(folderPath, fileName).replace(/\\/g, '/'));
}
};

Expand Down
2 changes: 1 addition & 1 deletion streams9/streams8.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function generateFileListCache(cachePath) {
var fileName = fileList[i];
var filePath = getFilePath(cachePath, fileName);

var folderName = fileName
var folderName = fileName;

var pos = folderName.lastIndexOf('/');

Expand Down

0 comments on commit 3ec9147

Please sign in to comment.