Code

http-backend: use end_url_with_slash()
authorTay Ray Chuan <rctay89@gmail.com>
Thu, 25 Nov 2010 08:21:06 +0000 (16:21 +0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 26 Nov 2010 22:50:45 +0000 (14:50 -0800)
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http-backend.c

index 14c90c2e84afd9997e1a6453f0065b3f59b32e57..85015048dd466fb2f2afe12086379ecf579d0a56 100644 (file)
@@ -510,9 +510,7 @@ static char* getdir(void)
                        die("GIT_PROJECT_ROOT is set but PATH_INFO is not");
                if (daemon_avoid_alias(pathinfo))
                        die("'%s': aliased", pathinfo);
-               strbuf_addstr(&buf, root);
-               if (buf.buf[buf.len - 1] != '/')
-                       strbuf_addch(&buf, '/');
+               end_url_with_slash(&buf, root);
                if (pathinfo[0] == '/')
                        pathinfo++;
                strbuf_addstr(&buf, pathinfo);