diff options
| author | 2003-06-26 04:52:26 +0000 | |
|---|---|---|
| committer | 2003-06-26 04:52:26 +0000 | |
| commit | 48b947b71e6d4333c359c506becf23ba6bc3e83e (patch) | |
| tree | ce3e198f10e43448c205830f9fe521f003be9e09 /usr.bin/diff/diff.c | |
| parent | off by one in size calculation (diff) | |
| download | wireguard-openbsd-48b947b71e6d4333c359c506becf23ba6bc3e83e.tar.xz wireguard-openbsd-48b947b71e6d4333c359c506becf23ba6bc3e83e.zip | |
Fix temp file handling and deal with the case where we might need 2 temp files.
Diffstat (limited to 'usr.bin/diff/diff.c')
| -rw-r--r-- | usr.bin/diff/diff.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/usr.bin/diff/diff.c b/usr.bin/diff/diff.c index 514bf394567..556086c45de 100644 --- a/usr.bin/diff/diff.c +++ b/usr.bin/diff/diff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff.c,v 1.12 2003/06/26 00:20:48 tedu Exp $ */ +/* $OpenBSD: diff.c,v 1.13 2003/06/26 04:52:26 millert Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -84,9 +84,9 @@ char **diffargv; /* option list to pass to recursive diffs */ char *file1, *file2, *efile1, *efile2; struct stat stb1, stb2; -char diff[] = _PATH_DIFF; -char diffh[] = _PATH_DIFFH; -char pr[] = _PATH_PR; +const char *diff = _PATH_DIFF; +const char *diffh = _PATH_DIFFH; +const char *pr = _PATH_PR; static void noroom(void); __dead void usage(void); @@ -215,8 +215,10 @@ max(int a, int b) __dead void done(int sig) { - if (tempfile) - unlink(tempfile); + if (tempfiles[0]) + unlink(tempfiles[0]); + if (tempfiles[1]) + unlink(tempfiles[1]); if (sig) _exit(status); exit(status); |
