simplify condition test for trailing /
Merge pull request #422 from pengfei-xue/devel

simplify condition test for trailing /