{"action":"created","issue":{"url":"https://api.github.com/repos/jruby/jruby/issues/3665","repository_url":"https://api.github.com/repos/jruby/jruby","labels_url":"https://api.github.com/repos/jruby/jruby/issues/3665/labels{/name}","comments_url":"https://api.github.com/repos/jruby/jruby/issues/3665/comments","events_url":"https://api.github.com/repos/jruby/jruby/issues/3665/events","html_url":"https://github.com/jruby/jruby/issues/3665","id":133531878,"number":3665,"title":"Dir.pwd showing wrong Windows UNC path when UNC path is a current directory at startup","user":{"login":"rsim","id":4736,"avatar_url":"https://avatars.githubusercontent.com/u/4736?v=3","gravatar_id":"","url":"https://api.github.com/users/rsim","html_url":"https://github.com/rsim","followers_url":"https://api.github.com/users/rsim/followers","following_url":"https://api.github.com/users/rsim/following{/other_user}","gists_url":"https://api.github.com/users/rsim/gists{/gist_id}","starred_url":"https://api.github.com/users/rsim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsim/subscriptions","organizations_url":"https://api.github.com/users/rsim/orgs","repos_url":"https://api.github.com/users/rsim/repos","events_url":"https://api.github.com/users/rsim/events{/privacy}","received_events_url":"https://api.github.com/users/rsim/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jruby/jruby/labels/windows","name":"windows","color":"0b02e1"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/jruby/jruby/milestones/48","html_url":"https://github.com/jruby/jruby/milestones/JRuby%201.7.25","labels_url":"https://api.github.com/repos/jruby/jruby/milestones/48/labels","id":1427640,"number":48,"title":"JRuby 1.7.25","description":"","creator":{"login":"enebo","id":19819,"avatar_url":"https://avatars.githubusercontent.com/u/19819?v=3","gravatar_id":"","url":"https://api.github.com/users/enebo","html_url":"https://github.com/enebo","followers_url":"https://api.github.com/users/enebo/followers","following_url":"https://api.github.com/users/enebo/following{/other_user}","gists_url":"https://api.github.com/users/enebo/gists{/gist_id}","starred_url":"https://api.github.com/users/enebo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enebo/subscriptions","organizations_url":"https://api.github.com/users/enebo/orgs","repos_url":"https://api.github.com/users/enebo/repos","events_url":"https://api.github.com/users/enebo/events{/privacy}","received_events_url":"https://api.github.com/users/enebo/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":1,"state":"open","created_at":"2015-11-24T16:55:20Z","updated_at":"2016-02-15T14:37:04Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2016-02-14T11:32:51Z","updated_at":"2016-02-15T14:37:48Z","closed_at":null,"body":"There is a strange `Dir.pwd` bug which shows current Windows UNC path `//server/share/directory` as `//server/share/:/server/share/directory` if JRuby was started from this Windows UNC path as a current directory. I debugged that this invalid Windows drive `//server/share/:` is added by `org.jruby.util.NormalizedFile` class method `getCanonicalPath`.\r\n\r\nSee how to reproduce the issue. Start Windows Power Shell (as cmd.exe does not support changing the current directory to Windows UNC path) and execute the following commands. `-Djruby.home` is added due to the https://github.com/jruby/jruby/issues/3661 issue.\r\n\r\n```\r\nPS C:\\> cd \\\\server\\share\\directory\r\nPS Microsoft.PowerShell.Core\\FileSystem::\\\\server\\share\\directory> java \"-Djruby.home=uri:classloader://META-INF/jruby.home\" -jar jruby-complete-1.7.24.jar -S irb\r\nirb(main):001:0> Dir.pwd\r\n=> \"//server/share/:/server/share/directory\"\r\nirb(main):002:0> org.jruby.util.NormalizedFile.new(JRuby.runtime.getCurrentDirectory).getCanonicalPath\r\n=> \"//server/share/:/server/share/directory\"\r\nirb(main):003:0> JRuby.runtime.getCurrentDirectory\r\n=> \"//server/share/directory\"\r\n```"},"comment":{"url":"https://api.github.com/repos/jruby/jruby/issues/comments/184233283","html_url":"https://github.com/jruby/jruby/issues/3665#issuecomment-184233283","issue_url":"https://api.github.com/repos/jruby/jruby/issues/3665","id":184233283,"user":{"login":"enebo","id":19819,"avatar_url":"https://avatars.githubusercontent.com/u/19819?v=3","gravatar_id":"","url":"https://api.github.com/users/enebo","html_url":"https://github.com/enebo","followers_url":"https://api.github.com/users/enebo/followers","following_url":"https://api.github.com/users/enebo/following{/other_user}","gists_url":"https://api.github.com/users/enebo/gists{/gist_id}","starred_url":"https://api.github.com/users/enebo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enebo/subscriptions","organizations_url":"https://api.github.com/users/enebo/orgs","repos_url":"https://api.github.com/users/enebo/repos","events_url":"https://api.github.com/users/enebo/events{/privacy}","received_events_url":"https://api.github.com/users/enebo/received_events","type":"User","site_admin":false},"created_at":"2016-02-15T14:37:48Z","updated_at":"2016-02-15T14:37:48Z","body":"@rsim thanks for reducing this so much"}}