{"action":"created","issue":{"url":"https://api.github.com/repos/xrootd/xrootd/issues/260","labels_url":"https://api.github.com/repos/xrootd/xrootd/issues/260/labels{/name}","comments_url":"https://api.github.com/repos/xrootd/xrootd/issues/260/comments","events_url":"https://api.github.com/repos/xrootd/xrootd/issues/260/events","html_url":"https://github.com/xrootd/xrootd/issues/260","id":94288864,"number":260,"title":"XrdOucString::endswith is buggy","user":{"login":"apeters1971","id":2655845,"avatar_url":"https://avatars.githubusercontent.com/u/2655845?v=3","gravatar_id":"","url":"https://api.github.com/users/apeters1971","html_url":"https://github.com/apeters1971","followers_url":"https://api.github.com/users/apeters1971/followers","following_url":"https://api.github.com/users/apeters1971/following{/other_user}","gists_url":"https://api.github.com/users/apeters1971/gists{/gist_id}","starred_url":"https://api.github.com/users/apeters1971/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apeters1971/subscriptions","organizations_url":"https://api.github.com/users/apeters1971/orgs","repos_url":"https://api.github.com/users/apeters1971/repos","events_url":"https://api.github.com/users/apeters1971/events{/privacy}","received_events_url":"https://api.github.com/users/apeters1971/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"gganis","id":1735130,"avatar_url":"https://avatars.githubusercontent.com/u/1735130?v=3","gravatar_id":"","url":"https://api.github.com/users/gganis","html_url":"https://github.com/gganis","followers_url":"https://api.github.com/users/gganis/followers","following_url":"https://api.github.com/users/gganis/following{/other_user}","gists_url":"https://api.github.com/users/gganis/gists{/gist_id}","starred_url":"https://api.github.com/users/gganis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gganis/subscriptions","organizations_url":"https://api.github.com/users/gganis/orgs","repos_url":"https://api.github.com/users/gganis/repos","events_url":"https://api.github.com/users/gganis/events{/privacy}","received_events_url":"https://api.github.com/users/gganis/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-07-10T11:26:36Z","updated_at":"2015-07-11T02:58:20Z","closed_at":"2015-07-11T02:58:20Z","body":"If the the suffix string to test has one character more then the string to check, the function claims that XrdOucString ensdwith (s), e.g.\r\n\r\nXrdOucString ew = \"abcd\";\r\n\r\new.endswith(\"abcde\") => true\r\n\r\nbecause STR_NPOS=-1\r\n \r\n```\r\n//______________________________________________________________________________\r\nbool XrdOucString::endswith(const char *s)\r\n{\r\n// returns 1 if the stored string ends with string s\r\nreturn (s ? (rfind(s) == (int)(len-strlen(s))) : 0);\r\n}\r\n```\r\n\r\nThe character function has probably the same issue when the XrdOucString is empty:\r\n\r\n```\r\n//______________________________________________________________________________\r\nbool XrdOucString::endswith(char c)\r\n{\r\n// returns 1 if the stored string ends with string s\r\nreturn (rfind(c) == (int)(len-1));\r\n}"},"comment":{"url":"https://api.github.com/repos/xrootd/xrootd/issues/comments/120565459","html_url":"https://github.com/xrootd/xrootd/issues/260#issuecomment-120565459","issue_url":"https://api.github.com/repos/xrootd/xrootd/issues/260","id":120565459,"user":{"login":"abh3","id":2657143,"avatar_url":"https://avatars.githubusercontent.com/u/2657143?v=3","gravatar_id":"","url":"https://api.github.com/users/abh3","html_url":"https://github.com/abh3","followers_url":"https://api.github.com/users/abh3/followers","following_url":"https://api.github.com/users/abh3/following{/other_user}","gists_url":"https://api.github.com/users/abh3/gists{/gist_id}","starred_url":"https://api.github.com/users/abh3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abh3/subscriptions","organizations_url":"https://api.github.com/users/abh3/orgs","repos_url":"https://api.github.com/users/abh3/repos","events_url":"https://api.github.com/users/abh3/events{/privacy}","received_events_url":"https://api.github.com/users/abh3/received_events","type":"User","site_admin":false},"created_at":"2015-07-11T02:58:20Z","updated_at":"2015-07-11T02:58:20Z","body":"For some reason this was not closed with the commit message. So, I am doing it now. It was fixes with commits 6b4e3aec and 9c541c5d just hours ago."}}