Escape path separator when using it as part of a regexp. [closes #233]

Former-commit-id: 95d28187ee573ecc26e44f30cb5fb7457877dd06
This commit is contained in:
John-David Dalton
2013-04-09 08:35:05 -07:00
parent ad0c287053
commit 76aae8ce42
3 changed files with 3 additions and 6 deletions

View File

@@ -47,7 +47,7 @@
var mediaType = 'application/vnd.github.v3.raw';
/** Used to detect the Node.js executable in command-line arguments */
var reNode = RegExp('(?:^|' + path.sep + ')node(?:\\.exe)?$');
var reNode = RegExp('(?:^|' + path.sep.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + ')node(?:\\.exe)?$');
/** Used to reference parts of the blob href */
var location = (function() {