diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2003-07-09 00:39:27 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2003-07-09 00:39:27 +0000 |
commit | 089089a1672ee8ebfd18aea28f2867e4784556f8 (patch) | |
tree | 3ac3cf41f2c9d5d1c1e5899ad078cd2c8ccfef71 /usr.bin/diff/diff.h | |
parent | 553e0315fd0d1bd47119cb903dd1783a20954223 (diff) |
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
Diffstat (limited to 'usr.bin/diff/diff.h')
-rw-r--r-- | usr.bin/diff/diff.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/usr.bin/diff/diff.h b/usr.bin/diff/diff.h index b08f10120f2..9ff20a8e913 100644 --- a/usr.bin/diff/diff.h +++ b/usr.bin/diff/diff.h @@ -1,4 +1,4 @@ -/* $OpenBSD: diff.h,v 1.18 2003/07/09 00:07:44 millert Exp $ */ +/* $OpenBSD: diff.h,v 1.19 2003/07/09 00:39:25 millert Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -59,7 +59,8 @@ #define D_BINARY 2 /* Binary files are different */ #define D_COMMON 3 /* Subdirectory common to both dirs */ #define D_ONLY 4 /* Only exists in one directory */ -#define D_ERROR 5 /* An error ocurred */ +#define D_MISMATCH 5 /* One path was a dir, the other a file */ +#define D_ERROR 6 /* An error ocurred */ struct excludes { char *pattern; @@ -68,13 +69,11 @@ struct excludes { extern int aflag, bflag, iflag, lflag, Nflag, Pflag, rflag, sflag, tflag, wflag; -extern char *start, *ifdefname; extern int format, context, status, anychange; -extern char *tempfiles[], *diffargs; +extern char *start, *ifdefname, *diffargs; extern struct stat stb1, stb2; extern struct excludes *excludes_list; -char *copytemp(const char *, int); char *splice(char *, char *); int diffreg(char *, char *, int); int easprintf(char **, const char *, ...); @@ -82,6 +81,3 @@ void *emalloc(size_t); void *erealloc(void *, size_t); void diffdir(char *, char *); void print_status(int, char *, char *, char *); -void quit(int); -__dead void error(const char *, ...); -__dead void errorx(const char *, ...); |