History log of /openbsd-src/usr.bin/diff/diffreg.c (Results 51 – 75 of 95)
Revision Date Author Comments
# a65ef95e 29-Jul-2003 deraadt <deraadt@openbsd.org>

clean


# 058e94f4 27-Jul-2003 millert <millert@openbsd.org>

We need to initialize clen to 0 each time through diffreg() for
when diffreg() is called multiple times (i.e. in directory mode).
Fixes a hang I saw doing "diff -r" of two large directory trees.


# 6e18f850 27-Jul-2003 otto <otto@openbsd.org>

- Use a heuristic to bound memory and cpu usage, at the cost of
producing suboptimal diffs for large file containing lots of changes.
Switch heuristic off with -d/--minimal (GNU compatible). Some hi

- Use a heuristic to bound memory and cpu usage, at the cost of
producing suboptimal diffs for large file containing lots of changes.
Switch heuristic off with -d/--minimal (GNU compatible). Some hints
from millert@.
- Improve performance by reducing the number of realloc(3) calls.

ok millert@ tedu@

show more ...


# 4640f069 23-Jul-2003 tedu <tedu@openbsd.org>

better ascii test for fewer false negatives. ok millert@


# 1f9aa9e0 22-Jul-2003 millert <millert@openbsd.org>

Implement the -L and -T options from GNU diff.


# 52e5bd6b 22-Jul-2003 millert <millert@openbsd.org>

Historically, when comparing two directories in -e mode, BSD diff
printed a header that turned the output into an actual script that
called ed(1) to make the changes. This conflicts with POSIX so th

Historically, when comparing two directories in -e mode, BSD diff
printed a header that turned the output into an actual script that
called ed(1) to make the changes. This conflicts with POSIX so the
header has been removed and the standard diff header is used instead.

show more ...


# f8a6bf23 22-Jul-2003 millert <millert@openbsd.org>

Don't print lines consisting solely of a dot ('.') in -e mode since
that will confuse ed(1).
POSIX says "one way to fix this bug is to output two periods whenever a lone
period is needed, then termin

Don't print lines consisting solely of a dot ('.') in -e mode since
that will confuse ed(1).
POSIX says "one way to fix this bug is to output two periods whenever a lone
period is needed, then terminate the append command with a period, and then
use the substitute command to convert the two periods into one period."
This is exactly what I have done.

show more ...


# 082b0f3d 21-Jul-2003 henning <henning@openbsd.org>

a little KNF


# fed3a06d 21-Jul-2003 millert <millert@openbsd.org>

POSIX-compliant output when there are two paths w/ the same name but
one is a file and the other is a directory in -r mode (cosmetic).


# 0efcb26e 21-Jul-2003 millert <millert@openbsd.org>

Expand change records array as needed; passes Otto's new regression test.


# 48e572ad 17-Jul-2003 millert <millert@openbsd.org>

cc -O2 -pipe -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 -DDIRENT=1 -DDYN_ALLOC -c unpGet rid of ugly hack in readhash() that appears to be there for
machines with a 16 bit word size. Also replace (HALFLO

cc -O2 -pipe -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 -DDIRENT=1 -DDYN_ALLOC -c unpGet rid of ugly hack in readhash() that appears to be there for
machines with a 16 bit word size. Also replace (HALFLONG - 1) with
a new define, HASHMASK since it really is a mask.
None of this results in any actual change in behavior.

show more ...


# bb34d48b 16-Jul-2003 millert <millert@openbsd.org>

Deal with files that lack a final newline before EOF (you naughty
emacs users!). In most cases this just means checking for EOF in
addition to '\n'. However, we need to tread carefully in readhash(

Deal with files that lack a final newline before EOF (you naughty
emacs users!). In most cases this just means checking for EOF in
addition to '\n'. However, we need to tread carefully in readhash().
There we return 0 on EOF iff it is the first char in a "line".

Additionally, if the -b or -w flags were specified and the last
character in one file was '\n' but the other file is missing '\n',
pretend that we didn't see the newline in the one file. This is
consistent with GNU diff. For the non-{b,w} case, print
"\ No newline at end of file" when we see EOF before a newline in
one file where the other file has one. Again, this is for consistency
with GNU diff and patch(1) in -current knows how to interpret this
message.

OK tedu@ and otto@

show more ...


# c72ea322 15-Jul-2003 millert <millert@openbsd.org>

Fix line ranges for unidiffs. Problem noted by otto@


# 7b6ec9e4 09-Jul-2003 millert <millert@openbsd.org>

Unlink temp file as soon as it is opened and return a FILE * for
it so we don't have to worry about cleanup. This means the quit()
signal handler and error/errorx can go away too.

Move splice() out

Unlink temp file as soon as it is opened and return a FILE * for
it so we don't have to worry about cleanup. This means the quit()
signal handler and error/errorx can go away too.

Move splice() out of diffreg() and into diff.c where it belongs
since we don't want to be calling splice() for a directory diff.
Add a check for mismatched paths (one file, one dir) in diffreg.c.

deraadt@ OK

show more ...


# b4bca33f 09-Jul-2003 millert <millert@openbsd.org>

Re-implement -l flag; diff -l now works correctly in non-directory
mode (like GNU diff).


# 318c3a70 08-Jul-2003 millert <millert@openbsd.org>

fix pasto in last commit


# b1a26502 08-Jul-2003 millert <millert@openbsd.org>

o Avoid a temp file if using stdin and stdin is redirected from a regular file
o Fix a double free in the temmp file case


# cab5d83c 06-Jul-2003 millert <millert@openbsd.org>

Add -q option from GNU diff


# 4ec4b3d5 06-Jul-2003 millert <millert@openbsd.org>

Some fairly major changes:
o -N is implemented
o -X is implemented
o -x is implemented
o diff.c has been rewritten and GNU long options are now supported
o diffdir.c has been rewritten
+ no

Some fairly major changes:
o -N is implemented
o -X is implemented
o -x is implemented
o diff.c has been rewritten and GNU long options are now supported
o diffdir.c has been rewritten
+ no longer does fork + exec of /usr/bin/diff
+ can be called recursively (and will be for -r)
o diff.h
+ don't include any .h files here any more, do it in the .c files
+ no Bell Labs code in this, gets a UCB copyright (the 32v sources
only have a diff.c and there is nothing in common).
o diffreg.c
+ most all remaining globals are now private to diffreg.c
+ files are only opened once
+ dynamically allocated objects are either freed or realloced
+ added missing UCB copyright (there were lots of UCB changes)
+ print correct thing when -s is specified
OK deraadt@

show more ...


# 1ba31747 04-Jul-2003 millert <millert@openbsd.org>

Kill diff -h, we don't use or want diffh. Discussed w/ tedu@


# c5b7f864 04-Jul-2003 millert <millert@openbsd.org>

Some cosmetic fixes:
o get rid of now-unused tempfile variable
o move inifdef into diffreg.c (only used there)
o correct a comment
o use _PATH_DIFF, _PATH_DIFFH and _PATH_PR instead of variables set

Some cosmetic fixes:
o get rid of now-unused tempfile variable
o move inifdef into diffreg.c (only used there)
o correct a comment
o use _PATH_DIFF, _PATH_DIFFH and _PATH_PR instead of variables set to them
o get rid of hack to look for pr and diff in /bin

show more ...


# ed544660 02-Jul-2003 millert <millert@openbsd.org>

Treat /dev/null specially; there is no need to make a temp file for it.


# 2a1593df 27-Jun-2003 tedu <tedu@openbsd.org>

-a to force ascii compare. ok millert


# 90f56ad8 26-Jun-2003 millert <millert@openbsd.org>

Remove cruft; We don't have the -I, -1 or -2 options anymore so we don't
need the associated scaffolding. tedu@ OK


# 66e5764e 26-Jun-2003 millert <millert@openbsd.org>

Fix temp file handling.
o honor TMPDIR environment variable as per man page
o need 2 temp files if both file1 and file2 are devices
o add error() and errorx() which cleanup temp file and then
call er

Fix temp file handling.
o honor TMPDIR environment variable as per man page
o need 2 temp files if both file1 and file2 are devices
o add error() and errorx() which cleanup temp file and then
call err() and errx() respectively.

OK tedu@

show more ...


1234