From: John Resig Date: Thu, 31 Aug 2006 05:16:50 +0000 (+0000) Subject: Added fix for broken $("../..",foo). X-Git-Tag: 1.0~5 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=45a3c06e8fd4ac04f5d914ecf5d2e25148160b3b;p=jquery.git Added fix for broken $("../..",foo). --- diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 28f4825e8..f64835a08 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -1199,6 +1199,8 @@ jQuery.extend({ var foundToken = false; for ( var i = 0; i < jQuery.token.length; i += 2 ) { + if ( foundToken ) continue; + var re = new RegExp("^(" + jQuery.token[i] + ")"); var m = re.exec(t); @@ -1235,12 +1237,12 @@ jQuery.extend({ ); } } - } - if ( t ) { - var val = jQuery.filter(t,r); - ret = r = val.r; - t = jQuery.trim(val.t); + if ( t ) { + var val = jQuery.filter(t,r); + ret = r = val.r; + t = jQuery.trim(val.t); + } } }