{"thread":{"id":"2545","subject":"[PATCH] Fix compilation of git.c","startedAt":"2005-11-16T01:44:12Z","lastAt":"2005-11-16T06:54:30Z","messageCount":3,"participants":["Johannes Schindelin","Junio C Hamano","Andreas Ericsson"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"11976","messageId":"Pine.LNX.4.63.0511160243360.14176@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2545","inReplyTo":null,"subject":"[PATCH] Fix compilation of git.c","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-11-16T01:44:12Z","receivedAt":"2005-11-16T01:44:12Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nSome systems do not define GLOB_ABORTED and GLOB_NOMATCH.\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n\n---\n\n git.c |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\napplies-to: c20dc1194fcfa73a7bf6e9d315c878d4f8c2828a\n57cce66195a824221c0e9517ff4999daf2fbe2d2\ndiff --git a/git.c b/git.c\nindex 583923d..30b3c04 100644\n--- a/git.c\n+++ b/git.c\n@@ -77,13 +77,17 @@ static void list_commands(const char *ex\n \tcase GLOB_NOSPACE:\n \t\tputs(\"Out of memory when running glob()\");\n \t\texit(2);\n+#ifdef GLOB_ABORTED\n \tcase GLOB_ABORTED:\n \t\tprintf(\"'%s': Read error: %s\\n\", exec_path, strerror(errno));\n \t\texit(2);\n+#endif\n+#ifdef GLOB_NOMATCH\n \tcase GLOB_NOMATCH:\n \t\tprintf(\"No git commands available in '%s'.\\n\", exec_path);\n \t\tprintf(\"Do you need to specify --exec-path or set GIT_EXEC_PATH?\\n\");\n \t\texit(1);\n+#endif\n \t}\n \n \tfor (i = 0; i < gl.gl_pathc; i++) {\n---\n0.99.9.GIT\n"},{"id":"11984","messageId":"7v4q6de1oc.fsf@assigned-by-dhcp.cox.net","threadId":"2545","inReplyTo":"Pine.LNX.4.63.0511160243360.14176@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Fix compilation of git.c","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-16T03:01:23Z","receivedAt":"2005-11-16T03:01:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Some systems do not define GLOB_ABORTED and GLOB_NOMATCH.\n\nThat's true, but the glob does not distinguish executables and\nothers anyway, do wouldn't it be more portable and easier to do\nreaddir, stat and list in the loop?\n"},{"id":"11995","messageId":"437AD7A6.6050906@op5.se","threadId":"2545","inReplyTo":"7v4q6de1oc.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Fix compilation of git.c","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2005-11-16T06:54:30Z","receivedAt":"2005-11-16T06:54:30Z","isPatch":true,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Junio C Hamano wrote:\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> \n>>Some systems do not define GLOB_ABORTED and GLOB_NOMATCH.\n> \n> \n> That's true, but the glob does not distinguish executables and\n> others anyway, do wouldn't it be more portable and easier to do\n> readdir, stat and list in the loop?\n> \n\nGot one implementation of that too, but it doesn't sort the command list \nand I thought it was nice to have them that way while too lazy to \nimplement myself.\n\nOTOH, that switch/case thing was for debugging (forgot prefix=/usr when \ncompiling...). I'm perfectly fine with\n\nif (glob(....)) {\n\terror_out(\"friendly message\");\n}\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"}]}