From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Subject: [PATCH 04/34] path.c: rename vsnpath() to do_git_path() Date: Sun, 30 Nov 2014 15:24:29 +0700 Message-ID: <1417335899-27307-5-git-send-email-pclouds@gmail.com> References: <1417335899-27307-1-git-send-email-pclouds@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Junio C Hamano , =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Sun Nov 30 09:25:51 2014 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XuzpG-0007DD-QD for gcvg-git-2@plane.gmane.org; Sun, 30 Nov 2014 09:25:51 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751945AbaK3IZr convert rfc822-to-quoted-printable (ORCPT ); Sun, 30 Nov 2014 03:25:47 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:65109 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751846AbaK3IZq (ORCPT ); Sun, 30 Nov 2014 03:25:46 -0500 Received: by mail-pa0-f50.google.com with SMTP id bj1so9199586pad.9 for ; Sun, 30 Nov 2014 00:25:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=6TjQWHXD+KrYp9IjTq+9WmmboqwpRlZu9mmTHdxTMnY=; b=c6DnGY7q9JyRIONDHNGL1FJXBqG5E29KvRgKGPKycyRBI2Og/3sgagV+dCgnkojsu9 EvSZx5K8wOJcYaEm/JVk/9GF9ppMbOlSbOskyLVvyxNDJDwoLY6d16pLt6ast+QI2cKa TnWY8nB5LsxergDEA2q1PBpnrJ34cwt/vqNJ/zwwKbrVmSFd+SQq6J2r7Jte2aIbT/cj dR0mH75OdFohZH82Ib1kRQGZe0wVvMf4ViCFvSYcuiz3JwCcrQGVFt+u/3V7v8HPVioU dnyRoO03FB7aY8nyLBcko1ucFDVBCK37iCdo5hz7jW4uzTnnAbz33KpWVNjtmS8QUkVy mXxg== X-Received: by 10.68.195.41 with SMTP id ib9mr88007460pbc.15.1417335946515; Sun, 30 Nov 2014 00:25:46 -0800 (PST) Received: from lanh ([115.73.247.22]) by mx.google.com with ESMTPSA id b16sm14333510pdl.56.2014.11.30.00.25.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Nov 2014 00:25:46 -0800 (PST) Received: by lanh (sSMTP sendmail emulation); Sun, 30 Nov 2014 15:25:39 +0700 X-Mailer: git-send-email 2.1.0.rc0.78.gc0d8480 In-Reply-To: <1417335899-27307-1-git-send-email-pclouds@gmail.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: The name vsnpath() gives an impression that this is general path handling function. It's not. This is the underlying implementation of git_path(), git_pathdup() and strbuf_git_path() which will prefix $GIT_DIR in the result string. Signed-off-by: Nguy=E1=BB=85n Th=C3=A1i Ng=E1=BB=8Dc Duy --- path.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/path.c b/path.c index 47753aa..6991103 100644 --- a/path.c +++ b/path.c @@ -60,7 +60,7 @@ char *mksnpath(char *buf, size_t n, const char *fmt, = =2E..) return cleanup_path(buf); } =20 -static void vsnpath(struct strbuf *buf, const char *fmt, va_list args) +static void do_git_path(struct strbuf *buf, const char *fmt, va_list a= rgs) { const char *git_dir =3D get_git_dir(); strbuf_addstr(buf, git_dir); @@ -74,7 +74,7 @@ void strbuf_git_path(struct strbuf *sb, const char *f= mt, ...) { va_list args; va_start(args, fmt); - vsnpath(sb, fmt, args); + do_git_path(sb, fmt, args); va_end(args); } =20 @@ -83,7 +83,7 @@ char *git_pathdup(const char *fmt, ...) struct strbuf path =3D STRBUF_INIT; va_list args; va_start(args, fmt); - vsnpath(&path, fmt, args); + do_git_path(&path, fmt, args); va_end(args); return strbuf_detach(&path, NULL); } @@ -114,7 +114,7 @@ const char *git_path(const char *fmt, ...) struct strbuf *pathname =3D get_pathname(); va_list args; va_start(args, fmt); - vsnpath(pathname, fmt, args); + do_git_path(pathname, fmt, args); va_end(args); return pathname->buf; } --=20 2.1.0.rc0.78.gc0d8480