=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/diff/diffreg.c,v retrieving revision 1.45 retrieving revision 1.46 diff -c -r1.45 -r1.46 *** src/usr.bin/diff/diffreg.c 2003/07/29 18:38:47 1.45 --- src/usr.bin/diff/diffreg.c 2003/07/31 02:53:57 1.46 *************** *** 1,4 **** ! /* $OpenBSD: diffreg.c,v 1.45 2003/07/29 18:38:47 deraadt Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. --- 1,4 ---- ! /* $OpenBSD: diffreg.c,v 1.46 2003/07/31 02:53:57 millert Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. *************** *** 65,71 **** */ #ifndef lint ! static const char rcsid[] = "$OpenBSD: diffreg.c,v 1.45 2003/07/29 18:38:47 deraadt Exp $"; #endif /* not lint */ #include --- 65,71 ---- */ #ifndef lint ! static const char rcsid[] = "$OpenBSD: diffreg.c,v 1.46 2003/07/31 02:53:57 millert Exp $"; #endif /* not lint */ #include *************** *** 297,303 **** if (S_ISDIR(stb1.st_mode) != S_ISDIR(stb2.st_mode)) return (S_ISDIR(stb1.st_mode) ? D_MISMATCH1 : D_MISMATCH2); if (strcmp(file1, "-") == 0 && strcmp(file2, "-") == 0) ! goto notsame; if (flags & D_EMPTY1) f1 = fopen(_PATH_DEVNULL, "r"); --- 297,303 ---- if (S_ISDIR(stb1.st_mode) != S_ISDIR(stb2.st_mode)) return (S_ISDIR(stb1.st_mode) ? D_MISMATCH1 : D_MISMATCH2); if (strcmp(file1, "-") == 0 && strcmp(file2, "-") == 0) ! goto closem; if (flags & D_EMPTY1) f1 = fopen(_PATH_DEVNULL, "r"); *************** *** 352,358 **** goto closem; } - notsame: /* * Files certainly differ at this point; set status accordingly */ --- 352,357 ---- *************** *** 520,525 **** --- 519,525 ---- } } close(ifd); + lseek(ofd, (off_t)0, SEEK_SET); return (fdopen(ofd, "r")); }