From 5279de0e70e4f7c9c9607691c34b79d8c675695a Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Thu, 10 Nov 2011 11:11:43 -0800 Subject: fix($location): links without path segment should not change the path Closes #648 --- src/service/location.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/service/location.js b/src/service/location.js index d7286291..4d82dfae 100644 --- a/src/service/location.js +++ b/src/service/location.js @@ -238,8 +238,9 @@ LocationUrl.prototype = LocationHashbangUrl.prototype = { return this.$$url; var match = PATH_MATCH.exec(url); - this.path(decodeURIComponent(match[1] || '')).search(match[3] || '') - .hash(match[5] || '', replace); + if (match[1]) this.path(decodeURIComponent(match[1])); + if (match[2] || match[1]) this.search(match[3] || ''); + this.hash(match[5] || '', replace); return this; }, -- cgit v1.2.3