* [PATCH] Fix compilation of git.c
@ 2005-11-16 1:44 Johannes Schindelin
2005-11-16 3:01 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Schindelin @ 2005-11-16 1:44 UTC (permalink / raw)
To: git, junkio
Some systems do not define GLOB_ABORTED and GLOB_NOMATCH.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
git.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
applies-to: c20dc1194fcfa73a7bf6e9d315c878d4f8c2828a
57cce66195a824221c0e9517ff4999daf2fbe2d2
diff --git a/git.c b/git.c
index 583923d..30b3c04 100644
--- a/git.c
+++ b/git.c
@@ -77,13 +77,17 @@ static void list_commands(const char *ex
case GLOB_NOSPACE:
puts("Out of memory when running glob()");
exit(2);
+#ifdef GLOB_ABORTED
case GLOB_ABORTED:
printf("'%s': Read error: %s\n", exec_path, strerror(errno));
exit(2);
+#endif
+#ifdef GLOB_NOMATCH
case GLOB_NOMATCH:
printf("No git commands available in '%s'.\n", exec_path);
printf("Do you need to specify --exec-path or set GIT_EXEC_PATH?\n");
exit(1);
+#endif
}
for (i = 0; i < gl.gl_pathc; i++) {
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix compilation of git.c
2005-11-16 1:44 [PATCH] Fix compilation of git.c Johannes Schindelin
@ 2005-11-16 3:01 ` Junio C Hamano
2005-11-16 6:54 ` Andreas Ericsson
0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2005-11-16 3:01 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git, junkio
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Some systems do not define GLOB_ABORTED and GLOB_NOMATCH.
That's true, but the glob does not distinguish executables and
others anyway, do wouldn't it be more portable and easier to do
readdir, stat and list in the loop?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix compilation of git.c
2005-11-16 3:01 ` Junio C Hamano
@ 2005-11-16 6:54 ` Andreas Ericsson
0 siblings, 0 replies; 3+ messages in thread
From: Andreas Ericsson @ 2005-11-16 6:54 UTC (permalink / raw)
To: git
Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
>
>>Some systems do not define GLOB_ABORTED and GLOB_NOMATCH.
>
>
> That's true, but the glob does not distinguish executables and
> others anyway, do wouldn't it be more portable and easier to do
> readdir, stat and list in the loop?
>
Got one implementation of that too, but it doesn't sort the command list
and I thought it was nice to have them that way while too lazy to
implement myself.
OTOH, that switch/case thing was for debugging (forgot prefix=/usr when
compiling...). I'm perfectly fine with
if (glob(....)) {
error_out("friendly message");
}
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-11-16 6:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-16 1:44 [PATCH] Fix compilation of git.c Johannes Schindelin
2005-11-16 3:01 ` Junio C Hamano
2005-11-16 6:54 ` Andreas Ericsson
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).