* Q: do people compile with NO_FNMATCH on OpenBSD 5.2?
@ 2012-12-18 20:00 Junio C Hamano
2012-12-18 20:23 ` Greg Troxel
0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2012-12-18 20:00 UTC (permalink / raw)
To: git
I seem to get a failure from
git ls-files "a*"
in t/t0000-basic.sh if I link with platform's fnmatch().
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Q: do people compile with NO_FNMATCH on OpenBSD 5.2?
2012-12-18 20:00 Q: do people compile with NO_FNMATCH on OpenBSD 5.2? Junio C Hamano
@ 2012-12-18 20:23 ` Greg Troxel
2012-12-18 20:51 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Greg Troxel @ 2012-12-18 20:23 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
[-- Attachment #1: Type: text/plain, Size: 1648 bytes --]
Junio C Hamano <gitster@pobox.com> writes:
> I seem to get a failure from
>
> git ls-files "a*"
>
> in t/t0000-basic.sh if I link with platform's fnmatch().
Not what you asked, but on NetBSD 5.1, libc fnmatch is used, and with
git 1.8.0.1 that test passes.
This prompted me to look at the rest of the tests. All tests pass
(except for expected failures) until:
*** t0070-fundamental.sh ***
ok 1 - character classes (isspace, isalpha etc.)
not ok - 2 mktemp to nonexistent directory prints filename
#
# test_must_fail test-mktemp doesnotexist/testXXXXXX 2>err &&
# grep "doesnotexist/test" err
#
ok 3 - mktemp to unwritable directory prints filename
ok 4 - check for a bug in the regex routines
# failed 1 among 4 test(s)
1..4
Running this by hand, I get:
gdt 51 /usr/pkgsrc/devel/scmgit-base/work/git-1.8.0.1/t > ../test-mktemp foo/barXXXXXX > MKTEMP.stdout 2> MKTEMP.stderr; ls -l MKTEMP*
-rw-r--r-- 1 gdt wheel 121 Dec 18 15:14 MKTEMP.stderr
-rw-r--r-- 1 gdt wheel 0 Dec 18 15:14 MKTEMP.stdout
gdt 52 /usr/pkgsrc/devel/scmgit-base/work/git-1.8.0.1/t > cat MKTEMP.stderr
fatal: Unable to create temporary file '/usr/pkgsrc/devel/scmgit-base/work/git-1.8.0.1/t/foo': No such file or directory
It seems ENOENT is correct for the directory not existing. I think the
test is complaining that the failed call to mkstemp modified the
argument.
Looking at:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/mkstemp.html
I can't see that it requires anything in particular for the in/out
paramater when there is an error.
[-- Attachment #2: Type: application/pgp-signature, Size: 194 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Q: do people compile with NO_FNMATCH on OpenBSD 5.2?
2012-12-18 20:23 ` Greg Troxel
@ 2012-12-18 20:51 ` Junio C Hamano
2012-12-20 18:54 ` Greg Troxel
0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2012-12-18 20:51 UTC (permalink / raw)
To: Greg Troxel; +Cc: git, Arnout Engelen
Greg Troxel <gdt@ir.bbn.com> writes:
> *** t0070-fundamental.sh ***
> ok 1 - character classes (isspace, isalpha etc.)
> not ok - 2 mktemp to nonexistent directory prints filename
> #
> # test_must_fail test-mktemp doesnotexist/testXXXXXX 2>err &&
> # grep "doesnotexist/test" err
> #
> ok 3 - mktemp to unwritable directory prints filename
> ok 4 - check for a bug in the regex routines
> # failed 1 among 4 test(s)
> 1..4
>
> Running this by hand, I get:
>
> gdt 51 /usr/pkgsrc/devel/scmgit-base/work/git-1.8.0.1/t > ../test-mktemp foo/barXXXXXX > MKTEMP.stdout 2> MKTEMP.stderr; ls -l MKTEMP*
> -rw-r--r-- 1 gdt wheel 121 Dec 18 15:14 MKTEMP.stderr
> -rw-r--r-- 1 gdt wheel 0 Dec 18 15:14 MKTEMP.stdout
> gdt 52 /usr/pkgsrc/devel/scmgit-base/work/git-1.8.0.1/t > cat MKTEMP.stderr
> fatal: Unable to create temporary file '/usr/pkgsrc/devel/scmgit-base/work/git-1.8.0.1/t/foo': No such file or directory
>
> It seems ENOENT is correct for the directory not existing. I think the
> test is complaining that the failed call to mkstemp modified the
> argument.
>
> Looking at:
>
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/mkstemp.html
>
> I can't see that it requires anything in particular for the in/out
> paramater when there is an error.
True. Perhaps something like this.
-- >8 --
Subject: xmkstemp(): avoid showing truncated template more carefully
Some implementations of xmkstemp() leaves the given in/out buffer
truncated when they return with failure.
6cf6bb3 (Improve error messages when temporary file creation fails,
2010-12-18) attempted to show the real filename we tried to create
(but failed), and if that is not available due to such truncation,
to show the original template that was given by the caller.
But it failed to take into account that the given template could
have "directory/" in front, in which case the truncation point may
not be template[0] but somewhere else.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
wrapper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git c/wrapper.c w/wrapper.c
index 68739aa..a066e2e 100644
--- c/wrapper.c
+++ w/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);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: Q: do people compile with NO_FNMATCH on OpenBSD 5.2?
2012-12-18 20:51 ` Junio C Hamano
@ 2012-12-20 18:54 ` Greg Troxel
0 siblings, 0 replies; 4+ messages in thread
From: Greg Troxel @ 2012-12-20 18:54 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Arnout Engelen
[-- Attachment #1: Type: text/plain, Size: 629 bytes --]
[mkstemp truncating output on error]
diff --git c/wrapper.c w/wrapper.c
index 68739aa..a066e2e 100644
--- c/wrapper.c
+++ w/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);
Thanks for the quick fix.
I applied this patch to 1.8.0.1, and then the tests get all the way to
t1402 (separate msg when I figure out why).
[-- Attachment #2: Type: application/pgp-signature, Size: 194 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-12-20 18:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-18 20:00 Q: do people compile with NO_FNMATCH on OpenBSD 5.2? Junio C Hamano
2012-12-18 20:23 ` Greg Troxel
2012-12-18 20:51 ` Junio C Hamano
2012-12-20 18:54 ` Greg Troxel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).