diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-03-21 16:12:00 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-03-21 16:12:00 -0700 |
commit | 7603e3f8a2f9294f26e24eb8e2f50d403fb1a595 (patch) | |
tree | 2329386c6ce2e868bcb8968d06c1641d4784ffb6 /src/library.js | |
parent | f3ec1907dab69c066fb47618fa076b0779194e85 (diff) |
misc SDL stuff
Diffstat (limited to 'src/library.js')
-rw-r--r-- | src/library.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js index d4b8078f..0574bb8d 100644 --- a/src/library.js +++ b/src/library.js @@ -408,6 +408,13 @@ LibraryManager.library = { // Flush any partially-printed lines in stdout and stderr. Careful, they may have been closed if (FS.streams[2] && FS.streams[2].object.output.buffer.length > 0) FS.streams[2].object.output('\n'.charCodeAt(0)); if (FS.streams[3] && FS.streams[3].object.output.buffer.length > 0) FS.streams[3].object.output('\n'.charCodeAt(0)); + }, + + // Standardizes a path. Useful for making comparisons of pathnames work in a consistent manner. + // For example, ./file and file are really the same, so this function will remove ./ + standardizePath: function(path) { + if (path.substr(0, 2) == './') path = path.substr(2); + return path; } }, |