Skip to content

Commit

Permalink
Merge pull request adobe#17 from adobe/fixIssue16
Browse files Browse the repository at this point in the history
Fix issue16
  • Loading branch information
chrisbank committed Dec 20, 2011
2 parents 3940eb7 + 74a9c1f commit f55dddd
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
Binary file modified bin/mac/Brackets.app/Contents/MacOS/Brackets
Binary file not shown.
Binary file modified bin/mac/Brackets.app/Contents/MacOS/ffmpegsumo.so
Binary file not shown.
Binary file modified bin/mac/Brackets.app/Contents/MacOS/libcef.dylib
Binary file not shown.
10 changes: 10 additions & 0 deletions bin/mac/Brackets.app/Contents/Resources/brackets_extensions.js
Expand Up @@ -118,6 +118,16 @@ if (!brackets.fs)
brackets.fs.readdir = function(path, callback) {
native function ReadDir();
var resultString = ReadDir(path);

// File paths can have special characters, so escape them before parsing to JSON
resultString = resultString.replace(/\r/g, "\\r")
.replace(/\n/g, "\\n")
.replace(/\&/g, "\\&")
.replace(/\'/g, "\\'")
.replace(/\t/g, "\\t")
//.replace(/\b/g, "\\b") \\ TODO: leaving this in screws up Brackets launch. I don't know why
.replace(/\f/g, "\\f");

var result = JSON.parse(resultString || '[]');
callback(getLastError(), result);
};
Expand Down
11 changes: 10 additions & 1 deletion src/mac/Resources/brackets_extensions.js
Expand Up @@ -118,7 +118,16 @@ if (!brackets.fs)
brackets.fs.readdir = function(path, callback) {
native function ReadDir();
var resultString = ReadDir(path);
console.log( resultString );

// File paths can have special characters, so escape them before parsing to JSON
resultString = resultString.replace(/\r/g, "\\r")
.replace(/\n/g, "\\n")
.replace(/\&/g, "\\&")
.replace(/\'/g, "\\'")
.replace(/\t/g, "\\t")
//.replace(/\b/g, "\\b") \\ TODO: leaving this in screws up Brackets launch. I don't know why
.replace(/\f/g, "\\f");

var result = JSON.parse(resultString || '[]');
callback(getLastError(), result);
};
Expand Down

0 comments on commit f55dddd

Please sign in to comment.