{"thread":{"id":"36230","subject":"[PATCH v4 2/2] diff-no-index.c: read_directory_path() use is_dot_or_dotdot().","startedAt":"2014-03-19T15:46:30Z","lastAt":"2014-03-19T15:46:30Z","messageCount":1,"participants":["Andrei Dinu"],"isPatch":true,"patchVersion":4,"patchTotal":2},"messages":[{"id":"237079","messageId":"1395243990-6030-1-git-send-email-mandrei.dinu@gmail.com","threadId":"36230","inReplyTo":null,"subject":"[PATCH v4 2/2] diff-no-index.c: read_directory_path() use is_dot_or_dotdot().","fromName":"Andrei Dinu","fromEmail":"mandrei.dinu@gmail.com","sentAt":"2014-03-19T15:46:30Z","receivedAt":"2014-03-19T15:46:30Z","isPatch":true,"sender":{"key":"mandrei.dinu@gmail.com","avatar":null},"body":"Implement code so read_directory_path() use is_dot_or_dotdot() from \"dir.h\"\ninstead of strcmp().\n\nSigned-off-by: Andrei Dinu <mandrei.dinu@gmail.com>\n\n---\n I plan on applying to GSoc 2014.\n\n diff-no-index.c |    3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/diff-no-index.c b/diff-no-index.c\nindex 5e4a76c..2d1165f 100644\n--- a/diff-no-index.c\n+++ b/diff-no-index.c\n@@ -15,6 +15,7 @@\n #include \"log-tree.h\"\n #include \"builtin.h\"\n #include \"string-list.h\"\n+#include \"dir.h\"\n \n static int read_directory_path(const char *path, struct string_list *list)\n {\n@@ -25,7 +26,7 @@ static int read_directory_path(const char *path, struct string_list *list)\n \t\treturn error(\"Could not open directory %s\", path);\n \n \twhile ((e = readdir(dir)))\n-\t\tif (strcmp(\".\", e->d_name) && strcmp(\"..\", e->d_name))\n+\t\tif (!is_dot_or_dotdot(e->d_name))\n \t\t\tstring_list_insert(list, e->d_name);\n \n \tclosedir(dir);\n-- \n1.7.9.5\n"}]}