{"action":"created","issue":{"url":"https://api.github.com/repos/mitchellh/osext/issues/1","labels_url":"https://api.github.com/repos/mitchellh/osext/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/mitchellh/osext/issues/1/comments","events_url":"https://api.github.com/repos/mitchellh/osext/issues/1/events","html_url":"https://github.com/mitchellh/osext/issues/1","id":111051745,"number":1,"title":"Wrong executable path","user":{"login":"nvartolomei","id":543193,"avatar_url":"https://avatars.githubusercontent.com/u/543193?v=3","gravatar_id":"","url":"https://api.github.com/users/nvartolomei","html_url":"https://github.com/nvartolomei","followers_url":"https://api.github.com/users/nvartolomei/followers","following_url":"https://api.github.com/users/nvartolomei/following{/other_user}","gists_url":"https://api.github.com/users/nvartolomei/gists{/gist_id}","starred_url":"https://api.github.com/users/nvartolomei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvartolomei/subscriptions","organizations_url":"https://api.github.com/users/nvartolomei/orgs","repos_url":"https://api.github.com/users/nvartolomei/repos","events_url":"https://api.github.com/users/nvartolomei/events{/privacy}","received_events_url":"https://api.github.com/users/nvartolomei/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-12T20:41:18Z","updated_at":"2015-10-18T00:30:17Z","closed_at":"2015-10-18T00:30:17Z","body":"Hello,\r\n\r\nI saw a bug in `executable` function from `osext_sysctl.go`, it will give wrong path if executable is run from another directory by using relative path like `../some_executable`. However it works if run like `./../some_executable`.\r\n\r\n\r\nThis change should fix the issue.\r\n\r\n```\r\nfunc executable() (string, error) {\r\n    if getwdError != nil {\r\n        return string(buf), getwdError\r\n    } else {\r\n-       if buf[0] == '.' {\r\n+       if buf[0] == '.' && buf[1] == '/' {\r\n            buf = buf[1:]\r\n        }\r\n    if startUpcwd[len(startUpcwd)-1] != '/' {\r\n```\r\n\r\nAlso I noticed upstream has some other changes too, maybe it's a good idea to update this repo?\r\n\r\nShould I create a pull-request for above change?"},"comment":{"url":"https://api.github.com/repos/mitchellh/osext/issues/comments/148963720","html_url":"https://github.com/mitchellh/osext/issues/1#issuecomment-148963720","issue_url":"https://api.github.com/repos/mitchellh/osext/issues/1","id":148963720,"user":{"login":"mitchellh","id":1299,"avatar_url":"https://avatars.githubusercontent.com/u/1299?v=3","gravatar_id":"","url":"https://api.github.com/users/mitchellh","html_url":"https://github.com/mitchellh","followers_url":"https://api.github.com/users/mitchellh/followers","following_url":"https://api.github.com/users/mitchellh/following{/other_user}","gists_url":"https://api.github.com/users/mitchellh/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchellh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchellh/subscriptions","organizations_url":"https://api.github.com/users/mitchellh/orgs","repos_url":"https://api.github.com/users/mitchellh/repos","events_url":"https://api.github.com/users/mitchellh/events{/privacy}","received_events_url":"https://api.github.com/users/mitchellh/received_events","type":"User","site_admin":false},"created_at":"2015-10-18T00:30:17Z","updated_at":"2015-10-18T00:30:17Z","body":"I think we should just move to upstream. I hear that they moved to GitHub now so maybe we can just switch to the actual lib. \r\n\r\nhttps://github.com/kardianos/osext"}}