Commit | Line | Data |
---|---|---|
e0965d83 | 1 | #include <ctype.h> |
9174026c | 2 | #include "cache.h" |
3ebfd4aa | 3 | #include "diff.h" |
9174026c | 4 | |
f4f21ce3 | 5 | static int silent = 0; |
dc26bd89 | 6 | static int show_root_diff = 0; |
cee99d22 | 7 | static int verbose_header = 0; |
e0965d83 | 8 | static int ignore_merges = 1; |
73134b6d | 9 | static int recursive = 0; |
e0965d83 | 10 | static int read_stdin = 0; |
6cbd72f8 | 11 | static int line_termination = '\n'; |
3ebfd4aa | 12 | static int generate_patch = 0; |
5c97558c | 13 | static int detect_rename = 0; |
de809dbb | 14 | static int reverse_diff = 0; |
57fe64a4 | 15 | static int diff_score_opt = 0; |
057c7d30 | 16 | static const char *pickaxe = NULL; |
f4f21ce3 | 17 | static const char *header = NULL; |
cee99d22 | 18 | static const char *header_prefix = ""; |
9174026c | 19 | |
c5b42386 LT |
20 | // What paths are we interested in? |
21 | static int nr_paths = 0; | |
22 | static char **paths = NULL; | |
23 | static int *pathlens = NULL; | |
24 | ||
eeb79916 | 25 | static int diff_tree_sha1(const unsigned char *old, const unsigned char *new, const char *base); |
73134b6d LT |
26 | |
27 | static void update_tree_entry(void **bufp, unsigned long *sizep) | |
9174026c LT |
28 | { |
29 | void *buf = *bufp; | |
30 | unsigned long size = *sizep; | |
31 | int len = strlen(buf) + 1 + 20; | |
32 | ||
33 | if (size < len) | |
2de381f9 | 34 | die("corrupt tree file"); |
9174026c LT |
35 | *bufp = buf + len; |
36 | *sizep = size - len; | |
9174026c LT |
37 | } |
38 | ||
39 | static const unsigned char *extract(void *tree, unsigned long size, const char **pathp, unsigned int *modep) | |
40 | { | |
41 | int len = strlen(tree)+1; | |
42 | const unsigned char *sha1 = tree + len; | |
43 | const char *path = strchr(tree, ' '); | |
44 | ||
45 | if (!path || size < len + 20 || sscanf(tree, "%o", modep) != 1) | |
2de381f9 | 46 | die("corrupt tree file"); |
9174026c LT |
47 | *pathp = path+1; |
48 | return sha1; | |
49 | } | |
50 | ||
262e82b4 LT |
51 | static char *malloc_base(const char *base, const char *path, int pathlen) |
52 | { | |
53 | int baselen = strlen(base); | |
812666c8 | 54 | char *newbase = xmalloc(baselen + pathlen + 2); |
262e82b4 LT |
55 | memcpy(newbase, base, baselen); |
56 | memcpy(newbase + baselen, path, pathlen); | |
57 | memcpy(newbase + baselen + pathlen, "/", 2); | |
58 | return newbase; | |
59 | } | |
60 | ||
61 | static void show_file(const char *prefix, void *tree, unsigned long size, const char *base); | |
ed1a368b | 62 | static void show_tree(const char *prefix, void *tree, unsigned long size, const char *base); |
262e82b4 LT |
63 | |
64 | /* A file entry went away or appeared */ | |
73134b6d | 65 | static void show_file(const char *prefix, void *tree, unsigned long size, const char *base) |
9174026c LT |
66 | { |
67 | unsigned mode; | |
68 | const char *path; | |
69 | const unsigned char *sha1 = extract(tree, size, &path, &mode); | |
262e82b4 | 70 | |
f4f21ce3 LT |
71 | if (header) { |
72 | printf("%s", header); | |
73 | header = NULL; | |
74 | } | |
75 | ||
76 | if (silent) | |
77 | return; | |
78 | ||
262e82b4 LT |
79 | if (recursive && S_ISDIR(mode)) { |
80 | char type[20]; | |
81 | unsigned long size; | |
82 | char *newbase = malloc_base(base, path, strlen(path)); | |
83 | void *tree; | |
84 | ||
85 | tree = read_sha1_file(sha1, type, &size); | |
86 | if (!tree || strcmp(type, "tree")) | |
2de381f9 | 87 | die("corrupt tree sha %s", sha1_to_hex(sha1)); |
262e82b4 LT |
88 | |
89 | show_tree(prefix, tree, size, newbase); | |
57fe64a4 | 90 | |
262e82b4 LT |
91 | free(tree); |
92 | free(newbase); | |
93 | return; | |
94 | } | |
95 | ||
57fe64a4 | 96 | diff_addremove(prefix[0], mode, sha1, base, path); |
9174026c LT |
97 | } |
98 | ||
eeb79916 | 99 | static int compare_tree_entry(void *tree1, unsigned long size1, void *tree2, unsigned long size2, const char *base) |
9174026c LT |
100 | { |
101 | unsigned mode1, mode2; | |
102 | const char *path1, *path2; | |
103 | const unsigned char *sha1, *sha2; | |
73134b6d | 104 | int cmp, pathlen1, pathlen2; |
9174026c LT |
105 | |
106 | sha1 = extract(tree1, size1, &path1, &mode1); | |
107 | sha2 = extract(tree2, size2, &path2, &mode2); | |
108 | ||
73134b6d LT |
109 | pathlen1 = strlen(path1); |
110 | pathlen2 = strlen(path2); | |
e46091d5 | 111 | cmp = base_name_compare(path1, pathlen1, mode1, path2, pathlen2, mode2); |
9174026c | 112 | if (cmp < 0) { |
eeb79916 | 113 | show_file("-", tree1, size1, base); |
9174026c LT |
114 | return -1; |
115 | } | |
116 | if (cmp > 0) { | |
eeb79916 | 117 | show_file("+", tree2, size2, base); |
9174026c LT |
118 | return 1; |
119 | } | |
120 | if (!memcmp(sha1, sha2, 20) && mode1 == mode2) | |
121 | return 0; | |
262e82b4 LT |
122 | |
123 | /* | |
124 | * If the filemode has changed to/from a directory from/to a regular | |
aebb2679 | 125 | * file, we need to consider it a remove and an add. |
262e82b4 LT |
126 | */ |
127 | if (S_ISDIR(mode1) != S_ISDIR(mode2)) { | |
128 | show_file("-", tree1, size1, base); | |
129 | show_file("+", tree2, size2, base); | |
130 | return 0; | |
131 | } | |
132 | ||
133 | if (recursive && S_ISDIR(mode1)) { | |
eeb79916 | 134 | int retval; |
262e82b4 | 135 | char *newbase = malloc_base(base, path1, pathlen1); |
eeb79916 LT |
136 | retval = diff_tree_sha1(sha1, sha2, newbase); |
137 | free(newbase); | |
138 | return retval; | |
73134b6d LT |
139 | } |
140 | ||
f4f21ce3 LT |
141 | if (header) { |
142 | printf("%s", header); | |
143 | header = NULL; | |
144 | } | |
145 | if (silent) | |
146 | return 0; | |
147 | ||
57fe64a4 | 148 | diff_change(mode1, mode2, sha1, sha2, base, path1); |
9174026c LT |
149 | return 0; |
150 | } | |
151 | ||
c5b42386 LT |
152 | static int interesting(void *tree, unsigned long size, const char *base) |
153 | { | |
154 | const char *path; | |
155 | unsigned mode; | |
156 | int i; | |
157 | int baselen, pathlen; | |
158 | ||
159 | if (!nr_paths) | |
160 | return 1; | |
161 | ||
162 | (void)extract(tree, size, &path, &mode); | |
163 | ||
164 | pathlen = strlen(path); | |
165 | baselen = strlen(base); | |
166 | ||
167 | for (i=0; i < nr_paths; i++) { | |
168 | const char *match = paths[i]; | |
169 | int matchlen = pathlens[i]; | |
170 | ||
171 | if (baselen >= matchlen) { | |
172 | /* If it doesn't match, move along... */ | |
173 | if (strncmp(base, match, matchlen)) | |
174 | continue; | |
175 | ||
176 | /* The base is a subdirectory of a path which was specified. */ | |
177 | return 1; | |
178 | } | |
179 | ||
180 | /* Does the base match? */ | |
181 | if (strncmp(base, match, baselen)) | |
182 | continue; | |
183 | ||
184 | match += baselen; | |
185 | matchlen -= baselen; | |
186 | ||
187 | if (pathlen > matchlen) | |
188 | continue; | |
189 | ||
cb6c8ed2 LT |
190 | if (matchlen > pathlen) { |
191 | if (match[pathlen] != '/') | |
192 | continue; | |
850e82d8 LT |
193 | if (!S_ISDIR(mode)) |
194 | continue; | |
cb6c8ed2 LT |
195 | } |
196 | ||
c5b42386 LT |
197 | if (strncmp(path, match, pathlen)) |
198 | continue; | |
199 | ||
200 | return 1; | |
201 | } | |
202 | return 0; /* No matches */ | |
203 | } | |
204 | ||
ed1a368b LT |
205 | /* A whole sub-tree went away or appeared */ |
206 | static void show_tree(const char *prefix, void *tree, unsigned long size, const char *base) | |
207 | { | |
208 | while (size) { | |
209 | if (interesting(tree, size, base)) | |
210 | show_file(prefix, tree, size, base); | |
211 | update_tree_entry(&tree, &size); | |
212 | } | |
213 | } | |
214 | ||
eeb79916 | 215 | static int diff_tree(void *tree1, unsigned long size1, void *tree2, unsigned long size2, const char *base) |
9174026c LT |
216 | { |
217 | while (size1 | size2) { | |
c5b42386 LT |
218 | if (nr_paths && size1 && !interesting(tree1, size1, base)) { |
219 | update_tree_entry(&tree1, &size1); | |
220 | continue; | |
221 | } | |
222 | if (nr_paths && size2 && !interesting(tree2, size2, base)) { | |
223 | update_tree_entry(&tree2, &size2); | |
224 | continue; | |
225 | } | |
9174026c | 226 | if (!size1) { |
eeb79916 | 227 | show_file("+", tree2, size2, base); |
9174026c LT |
228 | update_tree_entry(&tree2, &size2); |
229 | continue; | |
230 | } | |
231 | if (!size2) { | |
eeb79916 | 232 | show_file("-", tree1, size1, base); |
9174026c LT |
233 | update_tree_entry(&tree1, &size1); |
234 | continue; | |
235 | } | |
eeb79916 | 236 | switch (compare_tree_entry(tree1, size1, tree2, size2, base)) { |
9174026c LT |
237 | case -1: |
238 | update_tree_entry(&tree1, &size1); | |
239 | continue; | |
240 | case 0: | |
241 | update_tree_entry(&tree1, &size1); | |
242 | /* Fallthrough */ | |
243 | case 1: | |
244 | update_tree_entry(&tree2, &size2); | |
245 | continue; | |
246 | } | |
667bb59b | 247 | die("git-diff-tree: internal error"); |
9174026c LT |
248 | } |
249 | return 0; | |
250 | } | |
251 | ||
eeb79916 | 252 | static int diff_tree_sha1(const unsigned char *old, const unsigned char *new, const char *base) |
9174026c | 253 | { |
9174026c LT |
254 | void *tree1, *tree2; |
255 | unsigned long size1, size2; | |
73134b6d | 256 | int retval; |
9174026c | 257 | |
e99d59ff | 258 | tree1 = read_object_with_reference(old, "tree", &size1, NULL); |
c1fdf2a6 | 259 | if (!tree1) |
2de381f9 | 260 | die("unable to read source tree (%s)", sha1_to_hex(old)); |
e99d59ff | 261 | tree2 = read_object_with_reference(new, "tree", &size2, NULL); |
c1fdf2a6 | 262 | if (!tree2) |
2de381f9 | 263 | die("unable to read destination tree (%s)", sha1_to_hex(new)); |
eeb79916 | 264 | retval = diff_tree(tree1, size1, tree2, size2, base); |
73134b6d LT |
265 | free(tree1); |
266 | free(tree2); | |
267 | return retval; | |
268 | } | |
269 | ||
38c6f780 JH |
270 | static void call_diff_setup(void) |
271 | { | |
272 | diff_setup(reverse_diff, (generate_patch ? -1 : line_termination)); | |
273 | } | |
274 | ||
275 | static void call_diff_flush(void) | |
276 | { | |
277 | if (detect_rename) | |
278 | diff_detect_rename(detect_rename, diff_score_opt); | |
279 | if (pickaxe) | |
280 | diff_pickaxe(pickaxe); | |
281 | diff_flush(NULL, 0); | |
282 | } | |
283 | ||
5c97558c JH |
284 | static int diff_tree_sha1_top(const unsigned char *old, |
285 | const unsigned char *new, const char *base) | |
286 | { | |
287 | int ret; | |
57fe64a4 | 288 | |
38c6f780 | 289 | call_diff_setup(); |
5c97558c | 290 | ret = diff_tree_sha1(old, new, base); |
38c6f780 | 291 | call_diff_flush(); |
5c97558c JH |
292 | return ret; |
293 | } | |
294 | ||
dc26bd89 LT |
295 | static int diff_root_tree(const unsigned char *new, const char *base) |
296 | { | |
297 | int retval; | |
298 | void *tree; | |
299 | unsigned long size; | |
300 | ||
38c6f780 | 301 | call_diff_setup(); |
e99d59ff | 302 | tree = read_object_with_reference(new, "tree", &size, NULL); |
dc26bd89 LT |
303 | if (!tree) |
304 | die("unable to read root tree (%s)", sha1_to_hex(new)); | |
305 | retval = diff_tree("", 0, tree, size, base); | |
306 | free(tree); | |
38c6f780 | 307 | call_diff_flush(); |
dc26bd89 LT |
308 | return retval; |
309 | } | |
310 | ||
cee99d22 LT |
311 | static int get_one_line(const char *msg, unsigned long len) |
312 | { | |
313 | int ret = 0; | |
314 | ||
315 | while (len--) { | |
316 | ret++; | |
317 | if (*msg++ == '\n') | |
318 | break; | |
319 | } | |
320 | return ret; | |
321 | } | |
322 | ||
a02ebff6 LT |
323 | static int add_author_info(char *buf, const char *line, int len) |
324 | { | |
325 | char *date; | |
326 | unsigned int namelen; | |
327 | unsigned long time; | |
328 | int tz; | |
329 | ||
330 | line += strlen("author "); | |
331 | date = strchr(line, '>'); | |
332 | if (!date) | |
333 | return 0; | |
334 | namelen = ++date - line; | |
335 | time = strtoul(date, &date, 10); | |
336 | tz = strtol(date, NULL, 10); | |
337 | ||
338 | return sprintf(buf, "Author: %.*s\nDate: %s\n", | |
339 | namelen, line, | |
340 | show_date(time, tz)); | |
341 | } | |
342 | ||
cee99d22 LT |
343 | static char *generate_header(const char *commit, const char *parent, const char *msg, unsigned long len) |
344 | { | |
3258c902 | 345 | static char this_header[16384]; |
cee99d22 LT |
346 | int offset; |
347 | ||
348 | offset = sprintf(this_header, "%s%s (from %s)\n", header_prefix, commit, parent); | |
349 | if (verbose_header) { | |
350 | int hdr = 1; | |
351 | ||
352 | for (;;) { | |
353 | const char *line = msg; | |
354 | int linelen = get_one_line(msg, len); | |
355 | ||
356 | if (!linelen) | |
357 | break; | |
3258c902 LT |
358 | |
359 | /* | |
360 | * We want some slop for indentation and a possible | |
361 | * final "...". Thus the "+ 20". | |
362 | */ | |
363 | if (offset + linelen + 20 > sizeof(this_header)) { | |
364 | memcpy(this_header + offset, " ...\n", 8); | |
365 | offset += 8; | |
cee99d22 | 366 | break; |
3258c902 | 367 | } |
cee99d22 LT |
368 | |
369 | msg += linelen; | |
370 | len -= linelen; | |
371 | if (linelen == 1) | |
372 | hdr = 0; | |
a02ebff6 LT |
373 | if (hdr) { |
374 | if (!memcmp(line, "author ", 7)) | |
375 | offset += add_author_info(this_header + offset, line, linelen); | |
cee99d22 | 376 | continue; |
a02ebff6 | 377 | } |
cee99d22 LT |
378 | memset(this_header + offset, ' ', 4); |
379 | memcpy(this_header + offset + 4, line, linelen); | |
380 | offset += linelen + 4; | |
381 | } | |
3258c902 LT |
382 | /* Make sure there is an EOLN */ |
383 | if (this_header[offset-1] != '\n') | |
384 | this_header[offset++] = '\n'; | |
385 | /* Add _another_ EOLN if we are doing diff output */ | |
386 | if (!silent) | |
387 | this_header[offset++] = '\n'; | |
cee99d22 LT |
388 | this_header[offset] = 0; |
389 | } | |
390 | ||
391 | return this_header; | |
392 | } | |
393 | ||
b11645be | 394 | static int diff_tree_commit(const unsigned char *commit, const char *name) |
e0965d83 | 395 | { |
e0965d83 | 396 | unsigned long size, offset; |
b11645be | 397 | char *buf = read_object_with_reference(commit, "commit", &size, NULL); |
e0965d83 | 398 | |
e0965d83 LT |
399 | if (!buf) |
400 | return -1; | |
401 | ||
73848892 LT |
402 | if (!name) { |
403 | static char commit_name[60]; | |
404 | strcpy(commit_name, sha1_to_hex(commit)); | |
405 | name = commit_name; | |
406 | } | |
407 | ||
dc26bd89 LT |
408 | /* Root commit? */ |
409 | if (show_root_diff && memcmp(buf + 46, "parent ", 7)) { | |
410 | header = generate_header(name, "root", buf, size); | |
411 | diff_root_tree(commit, ""); | |
412 | } | |
413 | ||
414 | /* More than one parent? */ | |
415 | if (ignore_merges) { | |
416 | if (!memcmp(buf + 46 + 48, "parent ", 7)) | |
417 | return 0; | |
418 | } | |
419 | ||
e0965d83 LT |
420 | offset = 46; |
421 | while (offset + 48 < size && !memcmp(buf + offset, "parent ", 7)) { | |
b11645be | 422 | unsigned char parent[20]; |
e0965d83 LT |
423 | if (get_sha1_hex(buf + offset + 7, parent)) |
424 | return -1; | |
b11645be | 425 | header = generate_header(name, sha1_to_hex(parent), buf, size); |
5c97558c | 426 | diff_tree_sha1_top(parent, commit, ""); |
d6db0107 | 427 | if (!header && verbose_header) { |
cee99d22 | 428 | header_prefix = "\ndiff-tree "; |
d6db0107 LT |
429 | /* |
430 | * Don't print multiple merge entries if we | |
431 | * don't print the diffs. | |
432 | */ | |
433 | if (silent) | |
434 | break; | |
435 | } | |
e0965d83 LT |
436 | offset += 48; |
437 | } | |
b11645be LT |
438 | return 0; |
439 | } | |
440 | ||
441 | static int diff_tree_stdin(char *line) | |
442 | { | |
443 | int len = strlen(line); | |
444 | unsigned char commit[20], parent[20]; | |
445 | static char this_header[1000]; | |
446 | ||
447 | if (!len || line[len-1] != '\n') | |
448 | return -1; | |
449 | line[len-1] = 0; | |
450 | if (get_sha1_hex(line, commit)) | |
451 | return -1; | |
452 | if (isspace(line[40]) && !get_sha1_hex(line+41, parent)) { | |
453 | line[40] = 0; | |
454 | line[81] = 0; | |
455 | sprintf(this_header, "%s (from %s)\n", line, line+41); | |
456 | header = this_header; | |
5c97558c | 457 | return diff_tree_sha1_top(parent, commit, ""); |
b11645be LT |
458 | } |
459 | line[40] = 0; | |
460 | return diff_tree_commit(commit, line); | |
e0965d83 LT |
461 | } |
462 | ||
5aad72f2 | 463 | static char *diff_tree_usage = |
52e95789 | 464 | "git-diff-tree [-p] [-r] [-z] [--stdin] [-M] [-C] [-R] [-S<string>] [-m] [-s] [-v] <tree-ish> <tree-ish>"; |
c5bac17a | 465 | |
73134b6d LT |
466 | int main(int argc, char **argv) |
467 | { | |
0a8365a1 | 468 | int nr_sha1; |
e0965d83 | 469 | char line[1000]; |
0a8365a1 | 470 | unsigned char sha1[2][20]; |
73134b6d | 471 | |
0a8365a1 | 472 | nr_sha1 = 0; |
c5b42386 | 473 | for (;;) { |
e0965d83 | 474 | char *arg; |
c5b42386 | 475 | |
e0965d83 LT |
476 | argv++; |
477 | argc--; | |
478 | arg = *argv; | |
0a8365a1 | 479 | if (!arg) |
c5b42386 LT |
480 | break; |
481 | ||
0a8365a1 LT |
482 | if (*arg != '-') { |
483 | if (nr_sha1 < 2 && !get_sha1(arg, sha1[nr_sha1])) { | |
484 | nr_sha1++; | |
485 | continue; | |
486 | } | |
487 | break; | |
488 | } | |
489 | ||
490 | if (!strcmp(arg, "--")) { | |
e0965d83 LT |
491 | argv++; |
492 | argc--; | |
493 | break; | |
494 | } | |
bf16c71e | 495 | if (!strcmp(arg, "-r")) { |
73134b6d LT |
496 | recursive = 1; |
497 | continue; | |
498 | } | |
de809dbb LT |
499 | if (!strcmp(arg, "-R")) { |
500 | reverse_diff = 1; | |
501 | continue; | |
502 | } | |
3ebfd4aa | 503 | if (!strcmp(arg, "-p")) { |
3a663fd9 | 504 | recursive = generate_patch = 1; |
3ebfd4aa JH |
505 | continue; |
506 | } | |
52e95789 JH |
507 | if (!strncmp(arg, "-S", 2)) { |
508 | pickaxe = arg + 2; | |
509 | continue; | |
510 | } | |
57fe64a4 | 511 | if (!strncmp(arg, "-M", 2)) { |
5c97558c | 512 | detect_rename = recursive = generate_patch = 1; |
57fe64a4 | 513 | diff_score_opt = diff_scoreopt_parse(arg); |
427dcb4b JH |
514 | continue; |
515 | } | |
516 | if (!strncmp(arg, "-C", 2)) { | |
517 | detect_rename = 2; | |
518 | recursive = generate_patch = 1; | |
519 | diff_score_opt = diff_scoreopt_parse(arg); | |
5c97558c JH |
520 | continue; |
521 | } | |
6cbd72f8 LT |
522 | if (!strcmp(arg, "-z")) { |
523 | line_termination = '\0'; | |
524 | continue; | |
525 | } | |
e0965d83 LT |
526 | if (!strcmp(arg, "-m")) { |
527 | ignore_merges = 0; | |
528 | continue; | |
529 | } | |
f4f21ce3 LT |
530 | if (!strcmp(arg, "-s")) { |
531 | silent = 1; | |
532 | continue; | |
533 | } | |
cee99d22 LT |
534 | if (!strcmp(arg, "-v")) { |
535 | verbose_header = 1; | |
536 | header_prefix = "diff-tree "; | |
537 | continue; | |
538 | } | |
e0965d83 LT |
539 | if (!strcmp(arg, "--stdin")) { |
540 | read_stdin = 1; | |
541 | continue; | |
542 | } | |
dc26bd89 LT |
543 | if (!strcmp(arg, "--root")) { |
544 | show_root_diff = 1; | |
545 | continue; | |
546 | } | |
c5bac17a | 547 | usage(diff_tree_usage); |
73134b6d LT |
548 | } |
549 | ||
e0965d83 | 550 | if (argc > 0) { |
c5b42386 LT |
551 | int i; |
552 | ||
e0965d83 LT |
553 | paths = argv; |
554 | nr_paths = argc; | |
812666c8 | 555 | pathlens = xmalloc(nr_paths * sizeof(int)); |
c5b42386 LT |
556 | for (i=0; i<nr_paths; i++) |
557 | pathlens[i] = strlen(paths[i]); | |
558 | } | |
559 | ||
0a8365a1 LT |
560 | switch (nr_sha1) { |
561 | case 0: | |
562 | if (!read_stdin) | |
563 | usage(diff_tree_usage); | |
564 | break; | |
565 | case 1: | |
73848892 | 566 | diff_tree_commit(sha1[0], NULL); |
0a8365a1 LT |
567 | break; |
568 | case 2: | |
5c97558c | 569 | diff_tree_sha1_top(sha1[0], sha1[1], ""); |
0a8365a1 LT |
570 | break; |
571 | } | |
572 | ||
e0965d83 | 573 | if (!read_stdin) |
0a8365a1 | 574 | return 0; |
e0965d83 LT |
575 | |
576 | while (fgets(line, sizeof(line), stdin)) | |
577 | diff_tree_stdin(line); | |
578 | ||
579 | return 0; | |
9174026c | 580 | } |