Index: subversion/libsvn_subr/path.c
===================================================================
--- subversion/libsvn_subr/path.c	(revision 16485)
+++ subversion/libsvn_subr/path.c	(working copy)
@@ -1175,7 +1175,26 @@
 
   /* Remove the trailing slash. */
   if ((canon_segments > 0 || uri) && *(dst - 1) == '/')
-    dst--;
+    {
+      /* A trailing slash was found, see if it is
+       * intentional by checking for an '@' in the
+       * last segment. */
+
+      /* point to the trailing slash */
+      char *traverser = dst - 1;
+
+      /* move back till a previous slash or @ */
+      while ( *--traverser &&
+              *traverser != '/' &&
+              *traverser != '@');
+
+      /* If an @ sign was found in the last segment
+       * replace the trailing slash with an @ */
+      if (*traverser == '@')
+        * (dst - 1) = '@';
+      else
+        dst--;
+    }
   
   *dst = '\0';
 
Index: subversion/tests/libsvn_subr/path-test.c
===================================================================
--- subversion/tests/libsvn_subr/path-test.c	(revision 16485)
+++ subversion/tests/libsvn_subr/path-test.c	(working copy)
@@ -665,11 +665,17 @@
     { ".///.foo",             ".foo" },
     { "../foo",               "../foo" },
     { "../../foo/",           "../../foo" },
+    { "../../foo@bar/",       "../../foo@bar@" },
+    { "../foo@dir/foo@file/", "../foo@dir/foo@file@" },
+    { "../foo@dir/foo/",      "../foo@dir/foo" },
     { "../../foo/..",         "../../foo/.." },
     { "/../../",              "/../.." },
     { "http://hst",           "http://hst" },
     { "http://hst/foo/../bar","http://hst/foo/../bar" },
     { "http://hst/",          "http://hst" },
+    { "http://hst/foo@bar/",  "http://hst/foo@bar@" },
+    { "http://hst@loc/f@b/",  "http://hst@loc/f@b@" },
+    { "http://hst@loc/foo/",  "http://hst@loc/foo" },
 #if defined(WIN32) || defined(__CYGWIN__)
     /* We permit UNC paths on Windows.  By definition UNC
      * paths must have two components so we should remove the
Index: subversion/tests/clients/cmdline/basic_tests.py
===================================================================
--- subversion/tests/clients/cmdline/basic_tests.py	(revision 16485)
+++ subversion/tests/clients/cmdline/basic_tests.py	(working copy)
@@ -1610,7 +1610,13 @@
   output, errlines = svntest.actions.run_and_verify_svn(None, ["xyz\n"], [],
                                                         'cat', url+'@')
 
+  # With the trailing "/", expect success.
+  output, errlines = svntest.actions.run_and_verify_svn(None, ["xyz\n"], [],
+                                                        'cat', wc_file+'/')
+  output, errlines = svntest.actions.run_and_verify_svn(None, ["xyz\n"], [],
+                                                        'cat', url+'/')
 
+
 #----------------------------------------------------------------------
 ########################################################################
 # Run the tests
