summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 34a3e69)
raw | patch | inline | side by side (parent: 34a3e69)
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Sat, 7 Jul 2007 18:19:08 +0000 (20:19 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 7 Jul 2007 18:53:49 +0000 (11:53 -0700) |
The static function read_directory in diff-lib.c is only ever called
with struct path_list lists with .strdup_paths turned on, i.e.
path_list_insert will strdup the paths for us (again). Let's take
advantage of that and stop doing it twice.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
with struct path_list lists with .strdup_paths turned on, i.e.
path_list_insert will strdup the paths for us (again). Let's take
advantage of that and stop doing it twice.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff-lib.c | patch | blob | history |
diff --git a/diff-lib.c b/diff-lib.c
index 7fb19c7b87fc39cc4515628e8623ccb92fbaa60e..92c0e39ad6f21e0511ee84052e2b762d6e447f61 100644 (file)
--- a/diff-lib.c
+++ b/diff-lib.c
while ((e = readdir(dir)))
if (strcmp(".", e->d_name) && strcmp("..", e->d_name))
- path_list_insert(xstrdup(e->d_name), list);
+ path_list_insert(e->d_name, list);
closedir(dir);
return 0;