When the realpath function supplied with Portable OpenSSH is used, one quickly discovers that it mangles the pathnames. The code that combines the 'real' directory name with the name of the last component has a special-case to handle a directory name consisting of only '/'. Sadly, when it comes time to use the 'needslash' variable, the test is backwards. When it needs a slash, it doesn't put one in, and vice versa. needslash==1 is supposed to mean that a slash is needed but the code tests for needslash==0. I guess I must have one of the few operating systems (the Stratus VOS POSIX environment) that doesn't supply a working version of realpath, and so rely upon this version. I found this bug in 3.7.1p2 but it is still present in 3.9p1. I've tested the fix and it works great. Found by using PuTTY psftp client get request to a system with the broken code; it only worked on files in the root ('/') directory; a file in a lower-level directory failed; the echoed pathname was always missing the final slash.
Oh heck. I see you fixed this bug in 3.9p1; perhaps even earlier. Sorry for the noise.
The realpath function was recently updates again (after 3.9p1), so you may want to test one of the development snapshots from http://www.openssh.com/portable.html#cvs
Please reopen if there is any issues with realpath() in -current.
Change all RESOLVED bug to CLOSED with the exception of the ones fixed post-4.4.