diff --git a/lib/client/dom.js b/lib/client/dom.js index 06c78402..9da9dbb2 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -1179,7 +1179,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; function selectByPattern(msg, files) { var allMsg = 'Specify file type for ' + msg + ' selection', i = 0, - n, + n = files && files.length, arr = [], type, matches = 0, @@ -1198,23 +1198,11 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; type = '*'; type = '^' + type; /* search from start of line */ - type = Util.replaceStr(type, '*', '.*\\'); + type = Util.replaceStr(type, '.', '\\.'); + type = Util.replaceStr(type, '*', '.*'); type = Util.replaceStr(type, '?', '.?\\'); - - arr = type && type.split(''); - n = arr.length; - - /* back slash at end of line - * do not need - */ - if (arr[n - 1] === '\\') { - arr.pop(); - type = arr.join(''); - } - type += '$'; /* search to end of line */ - n = files && files.length; do { if (shouldSel) current = files[i++];