summaryrefslogtreecommitdiff
path: root/devel/scmgit-base/patches/patch-wrapper.c
blob: 1239b72fc1478a6d4ae58f8710944b0a72dad485 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$NetBSD: patch-wrapper.c,v 1.1 2013/06/07 13:05:42 gdt Exp $

git's wrapper around mkstemp assumes that the libc function will not
modify the argument when the call fails.  This causes one of git's
tests to fail.  This patch is from Junio C. Hamano, and will likely be
included in future versions of git.

--- wrapper.c.orig	2012-11-26 03:18:01.000000000 +0000
+++ wrapper.c
@@ -229,7 +229,7 @@ int xmkstemp(char *template)
 		int saved_errno = errno;
 		const char *nonrelative_template;
 
-		if (!template[0])
+		if (strlen(template) != strlen(origtemplate))
 			template = origtemplate;
 
 		nonrelative_template = absolute_path(template);