diff: rewrite. much smaller and more correct

function                                             old     new   delta
diffreg                                             1815    3156   +1341
diff_main                                            860    1194    +334
read_token                                             -     161    +161
skip_dir                                               -      44     +44
seek_ft                                                -      31     +31
fetch                                                362     392     +30
line_compar                                            -      21     +21
add_to_dirlist                                        65      61      -4
print_only                                            16       -     -16
skipline                                              51       -     -51
newcand                                               85       -     -85
asciifile                                             89       -     -89
print_status                                         178      73    -105
make_temp                                            148       -    -148
files_differ                                         168       -    -168
get_recursive_dirlist                                182       -    -182
sort                                                 226       -    -226
prepare                                              283       -    -283
change                                               283       -    -283
do_diff                                              416       -    -416
dump_unified_vec                                     457       -    -457
check                                               1512     595    -917
------------------------------------------------------------------------------
(add/remove: 4/12 grow/shrink: 3/3 up/down: 1962/-3430)     Total: -1468 bytes

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Matheus Izvekov 2010-01-18 04:57:17 +01:00 committed by Denys Vlasenko
parent f3fc9ac166
commit d4a7728dc3
3 changed files with 788 additions and 1229 deletions

View File

@ -35,14 +35,6 @@ config DIFF
differences between them in a form that can be given to
the patch command.
config FEATURE_DIFF_BINARY
bool "Enable checks for binary files"
default y
depends on DIFF
help
This option enables support for checking for binary files
before a comparison is carried out.
config FEATURE_DIFF_DIR
bool "Enable directory support"
default y
@ -51,14 +43,6 @@ config FEATURE_DIFF_DIR
This option enables support for directory and subdirectory
comparison.
config FEATURE_DIFF_MINIMAL
bool "Enable -d option to find smaller sets of changes"
default n
depends on DIFF
help
Enabling this option allows the use of -d to make diff
try hard to find the smallest possible set of changes.
config ED
bool "ed"
default n

File diff suppressed because it is too large Load Diff

View File

@ -44,21 +44,18 @@ testing "diff of stdin, twice" \
"" \
"stdin"
test x"$SKIP_KNOWN_BUGS" = x"" && \
testing "diff -b treats EOF as whitespace" \
'diff -ub - input; echo $?' \
"0\n" \
"abc" \
"abc "
test x"$SKIP_KNOWN_BUGS" = x"" && \
testing "diff -b treats all spaces as equal" \
'diff -ub - input; echo $?' \
"0\n" \
"a \t c\n" \
"a\t \tc\n"
test x"$SKIP_KNOWN_BUGS" = x"" && \
testing "diff always takes context from old file" \
"diff -ub - input | $TRIM_TAB" \
"\