owncloud/core — pull request #5214 by ringmaster (2013-10-08 16:50:36+00:00)
Title: Don't double-slash filenames at the root.

Replace either the end of the dir string that isn't preceded by a slash or the slash at the end of the dir string with a slash and the filename.
This prevents the root directory from ending up as two slashes, which breaks files_versions on Windows servers. See #4079 for an explanation.