Merge branch 'jc/mkstemp-more-careful-error-reporting' into maint
authorJunio C Hamano <gitster@pobox.com>
Tue, 8 Jan 2013 19:16:58 +0000 (11:16 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 8 Jan 2013 19:16:58 +0000 (11:16 -0800)
* jc/mkstemp-more-careful-error-reporting:
xmkstemp(): avoid showing truncated template more carefully

wrapper.c
index 68739aaa3b9e9e1a1bbbd43c75c9b5c244fb6c3e..a066e2ee9e2cc90ad77547ee9f2267e255cf7d23 100644 (file)
--- a/wrapper.c
+++ b/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);