{"action":"closed","number":2029,"pull_request":{"url":"https://api.github.com/repos/stylus/stylus/pulls/2029","id":47608481,"html_url":"https://github.com/stylus/stylus/pull/2029","diff_url":"https://github.com/stylus/stylus/pull/2029.diff","patch_url":"https://github.com/stylus/stylus/pull/2029.patch","issue_url":"https://api.github.com/repos/stylus/stylus/issues/2029","number":2029,"state":"closed","locked":false,"title":"Fix middleware overlap function on windows.","user":{"login":"bcomnes","id":166301,"avatar_url":"https://avatars.githubusercontent.com/u/166301?v=3","gravatar_id":"","url":"https://api.github.com/users/bcomnes","html_url":"https://github.com/bcomnes","followers_url":"https://api.github.com/users/bcomnes/followers","following_url":"https://api.github.com/users/bcomnes/following{/other_user}","gists_url":"https://api.github.com/users/bcomnes/gists{/gist_id}","starred_url":"https://api.github.com/users/bcomnes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcomnes/subscriptions","organizations_url":"https://api.github.com/users/bcomnes/orgs","repos_url":"https://api.github.com/users/bcomnes/repos","events_url":"https://api.github.com/users/bcomnes/events{/privacy}","received_events_url":"https://api.github.com/users/bcomnes/received_events","type":"User","site_admin":false},"body":"The `compare` function was comparing file system paths, and url paths, but figuring out which separator to use based on the OS path separator `sep`.  This did not work on windows, and no overlap would be found because the url path never splits on `\\\\`.  \r\n\r\nThis fixes the compare function, and the part of the middleware that uses the overlap output so that the compare function translates the os path that might overlap with the url path into the correct path using a separator that can be compared to an url path.\r\n\r\nThis fixes windows compatibility, and unix/linux still works fine.\r\n\r\nI will submit a test in a moment.\r\n\r\n### Examples:\r\n\r\n\r\n```\r\napp.use(stylus.middleware({\r\n  src: path.join(__dirname, 'stylus'),\r\n  dest: path.join(__dirname, 'static', 'css')\r\n}))\r\n\r\napp.use(express.static(path.join(__dirname, 'static')))\r\n```\r\n\r\nThis currently works on unix, and fails on windows. The path transforms to `/css/file.css` to `/file.css` on unix, but remains `/css/file.css` on windows, causing the middleware to not render it because there is no css folder in the stylus folder.","created_at":"2015-10-14T01:21:04Z","updated_at":"2015-10-14T20:36:18Z","closed_at":"2015-10-14T20:36:18Z","merged_at":"2015-10-14T20:36:18Z","merge_commit_sha":"47865609a0409f83a13c3eba8a4ad860675596e9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/stylus/stylus/pulls/2029/commits","review_comments_url":"https://api.github.com/repos/stylus/stylus/pulls/2029/comments","review_comment_url":"https://api.github.com/repos/stylus/stylus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stylus/stylus/issues/2029/comments","statuses_url":"https://api.github.com/repos/stylus/stylus/statuses/dda5b280e18508403f465e1bac5dfbe40adb0f96","head":{"label":"bcomnes:patch-1","ref":"patch-1","sha":"dda5b280e18508403f465e1bac5dfbe40adb0f96","user":{"login":"bcomnes","id":166301,"avatar_url":"https://avatars.githubusercontent.com/u/166301?v=3","gravatar_id":"","url":"https://api.github.com/users/bcomnes","html_url":"https://github.com/bcomnes","followers_url":"https://api.github.com/users/bcomnes/followers","following_url":"https://api.github.com/users/bcomnes/following{/other_user}","gists_url":"https://api.github.com/users/bcomnes/gists{/gist_id}","starred_url":"https://api.github.com/users/bcomnes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcomnes/subscriptions","organizations_url":"https://api.github.com/users/bcomnes/orgs","repos_url":"https://api.github.com/users/bcomnes/repos","events_url":"https://api.github.com/users/bcomnes/events{/privacy}","received_events_url":"https://api.github.com/users/bcomnes/received_events","type":"User","site_admin":false},"repo":{"id":44215793,"name":"stylus","full_name":"bcomnes/stylus","owner":{"login":"bcomnes","id":166301,"avatar_url":"https://avatars.githubusercontent.com/u/166301?v=3","gravatar_id":"","url":"https://api.github.com/users/bcomnes","html_url":"https://github.com/bcomnes","followers_url":"https://api.github.com/users/bcomnes/followers","following_url":"https://api.github.com/users/bcomnes/following{/other_user}","gists_url":"https://api.github.com/users/bcomnes/gists{/gist_id}","starred_url":"https://api.github.com/users/bcomnes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcomnes/subscriptions","organizations_url":"https://api.github.com/users/bcomnes/orgs","repos_url":"https://api.github.com/users/bcomnes/repos","events_url":"https://api.github.com/users/bcomnes/events{/privacy}","received_events_url":"https://api.github.com/users/bcomnes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bcomnes/stylus","description":"Expressive, robust, feature-rich CSS language built for nodejs","fork":true,"url":"https://api.github.com/repos/bcomnes/stylus","forks_url":"https://api.github.com/repos/bcomnes/stylus/forks","keys_url":"https://api.github.com/repos/bcomnes/stylus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bcomnes/stylus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bcomnes/stylus/teams","hooks_url":"https://api.github.com/repos/bcomnes/stylus/hooks","issue_events_url":"https://api.github.com/repos/bcomnes/stylus/issues/events{/number}","events_url":"https://api.github.com/repos/bcomnes/stylus/events","assignees_url":"https://api.github.com/repos/bcomnes/stylus/assignees{/user}","branches_url":"https://api.github.com/repos/bcomnes/stylus/branches{/branch}","tags_url":"https://api.github.com/repos/bcomnes/stylus/tags","blobs_url":"https://api.github.com/repos/bcomnes/stylus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bcomnes/stylus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bcomnes/stylus/git/refs{/sha}","trees_url":"https://api.github.com/repos/bcomnes/stylus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bcomnes/stylus/statuses/{sha}","languages_url":"https://api.github.com/repos/bcomnes/stylus/languages","stargazers_url":"https://api.github.com/repos/bcomnes/stylus/stargazers","contributors_url":"https://api.github.com/repos/bcomnes/stylus/contributors","subscribers_url":"https://api.github.com/repos/bcomnes/stylus/subscribers","subscription_url":"https://api.github.com/repos/bcomnes/stylus/subscription","commits_url":"https://api.github.com/repos/bcomnes/stylus/commits{/sha}","git_commits_url":"https://api.github.com/repos/bcomnes/stylus/git/commits{/sha}","comments_url":"https://api.github.com/repos/bcomnes/stylus/comments{/number}","issue_comment_url":"https://api.github.com/repos/bcomnes/stylus/issues/comments{/number}","contents_url":"https://api.github.com/repos/bcomnes/stylus/contents/{+path}","compare_url":"https://api.github.com/repos/bcomnes/stylus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bcomnes/stylus/merges","archive_url":"https://api.github.com/repos/bcomnes/stylus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bcomnes/stylus/downloads","issues_url":"https://api.github.com/repos/bcomnes/stylus/issues{/number}","pulls_url":"https://api.github.com/repos/bcomnes/stylus/pulls{/number}","milestones_url":"https://api.github.com/repos/bcomnes/stylus/milestones{/number}","notifications_url":"https://api.github.com/repos/bcomnes/stylus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bcomnes/stylus/labels{/name}","releases_url":"https://api.github.com/repos/bcomnes/stylus/releases{/id}","created_at":"2015-10-14T01:16:28Z","updated_at":"2015-10-14T01:16:31Z","pushed_at":"2015-10-14T01:21:00Z","git_url":"git://github.com/bcomnes/stylus.git","ssh_url":"git@github.com:bcomnes/stylus.git","clone_url":"https://github.com/bcomnes/stylus.git","svn_url":"https://github.com/bcomnes/stylus","homepage":"http://learnboost.github.com/stylus/","size":7981,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"stylus:dev","ref":"dev","sha":"df9a60ab9c30a9c46878007c89d8b348328b4124","user":{"login":"stylus","id":10009463,"avatar_url":"https://avatars.githubusercontent.com/u/10009463?v=3","gravatar_id":"","url":"https://api.github.com/users/stylus","html_url":"https://github.com/stylus","followers_url":"https://api.github.com/users/stylus/followers","following_url":"https://api.github.com/users/stylus/following{/other_user}","gists_url":"https://api.github.com/users/stylus/gists{/gist_id}","starred_url":"https://api.github.com/users/stylus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stylus/subscriptions","organizations_url":"https://api.github.com/users/stylus/orgs","repos_url":"https://api.github.com/users/stylus/repos","events_url":"https://api.github.com/users/stylus/events{/privacy}","received_events_url":"https://api.github.com/users/stylus/received_events","type":"Organization","site_admin":false},"repo":{"id":1204214,"name":"stylus","full_name":"stylus/stylus","owner":{"login":"stylus","id":10009463,"avatar_url":"https://avatars.githubusercontent.com/u/10009463?v=3","gravatar_id":"","url":"https://api.github.com/users/stylus","html_url":"https://github.com/stylus","followers_url":"https://api.github.com/users/stylus/followers","following_url":"https://api.github.com/users/stylus/following{/other_user}","gists_url":"https://api.github.com/users/stylus/gists{/gist_id}","starred_url":"https://api.github.com/users/stylus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stylus/subscriptions","organizations_url":"https://api.github.com/users/stylus/orgs","repos_url":"https://api.github.com/users/stylus/repos","events_url":"https://api.github.com/users/stylus/events{/privacy}","received_events_url":"https://api.github.com/users/stylus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stylus/stylus","description":"Expressive, robust, feature-rich CSS language built for nodejs","fork":false,"url":"https://api.github.com/repos/stylus/stylus","forks_url":"https://api.github.com/repos/stylus/stylus/forks","keys_url":"https://api.github.com/repos/stylus/stylus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stylus/stylus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stylus/stylus/teams","hooks_url":"https://api.github.com/repos/stylus/stylus/hooks","issue_events_url":"https://api.github.com/repos/stylus/stylus/issues/events{/number}","events_url":"https://api.github.com/repos/stylus/stylus/events","assignees_url":"https://api.github.com/repos/stylus/stylus/assignees{/user}","branches_url":"https://api.github.com/repos/stylus/stylus/branches{/branch}","tags_url":"https://api.github.com/repos/stylus/stylus/tags","blobs_url":"https://api.github.com/repos/stylus/stylus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stylus/stylus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stylus/stylus/git/refs{/sha}","trees_url":"https://api.github.com/repos/stylus/stylus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stylus/stylus/statuses/{sha}","languages_url":"https://api.github.com/repos/stylus/stylus/languages","stargazers_url":"https://api.github.com/repos/stylus/stylus/stargazers","contributors_url":"https://api.github.com/repos/stylus/stylus/contributors","subscribers_url":"https://api.github.com/repos/stylus/stylus/subscribers","subscription_url":"https://api.github.com/repos/stylus/stylus/subscription","commits_url":"https://api.github.com/repos/stylus/stylus/commits{/sha}","git_commits_url":"https://api.github.com/repos/stylus/stylus/git/commits{/sha}","comments_url":"https://api.github.com/repos/stylus/stylus/comments{/number}","issue_comment_url":"https://api.github.com/repos/stylus/stylus/issues/comments{/number}","contents_url":"https://api.github.com/repos/stylus/stylus/contents/{+path}","compare_url":"https://api.github.com/repos/stylus/stylus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stylus/stylus/merges","archive_url":"https://api.github.com/repos/stylus/stylus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stylus/stylus/downloads","issues_url":"https://api.github.com/repos/stylus/stylus/issues{/number}","pulls_url":"https://api.github.com/repos/stylus/stylus/pulls{/number}","milestones_url":"https://api.github.com/repos/stylus/stylus/milestones{/number}","notifications_url":"https://api.github.com/repos/stylus/stylus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stylus/stylus/labels{/name}","releases_url":"https://api.github.com/repos/stylus/stylus/releases{/id}","created_at":"2010-12-28T22:11:43Z","updated_at":"2015-10-14T17:53:33Z","pushed_at":"2015-10-14T20:36:19Z","git_url":"git://github.com/stylus/stylus.git","ssh_url":"git@github.com:stylus/stylus.git","clone_url":"https://github.com/stylus/stylus.git","svn_url":"https://github.com/stylus/stylus","homepage":"http://learnboost.github.com/stylus/","size":16819,"stargazers_count":6215,"watchers_count":6215,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":848,"mirror_url":null,"open_issues_count":127,"forks":848,"open_issues":127,"watchers":6215,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/stylus/stylus/pulls/2029"},"html":{"href":"https://github.com/stylus/stylus/pull/2029"},"issue":{"href":"https://api.github.com/repos/stylus/stylus/issues/2029"},"comments":{"href":"https://api.github.com/repos/stylus/stylus/issues/2029/comments"},"review_comments":{"href":"https://api.github.com/repos/stylus/stylus/pulls/2029/comments"},"review_comment":{"href":"https://api.github.com/repos/stylus/stylus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stylus/stylus/pulls/2029/commits"},"statuses":{"href":"https://api.github.com/repos/stylus/stylus/statuses/dda5b280e18508403f465e1bac5dfbe40adb0f96"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"Panya","id":235637,"avatar_url":"https://avatars.githubusercontent.com/u/235637?v=3","gravatar_id":"","url":"https://api.github.com/users/Panya","html_url":"https://github.com/Panya","followers_url":"https://api.github.com/users/Panya/followers","following_url":"https://api.github.com/users/Panya/following{/other_user}","gists_url":"https://api.github.com/users/Panya/gists{/gist_id}","starred_url":"https://api.github.com/users/Panya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Panya/subscriptions","organizations_url":"https://api.github.com/users/Panya/orgs","repos_url":"https://api.github.com/users/Panya/repos","events_url":"https://api.github.com/users/Panya/events{/privacy}","received_events_url":"https://api.github.com/users/Panya/received_events","type":"User","site_admin":false},"comments":2,"review_comments":4,"commits":1,"additions":3,"deletions":3,"changed_files":1}}