=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/compress/main.c,v retrieving revision 1.55 retrieving revision 1.56 diff -u -r1.55 -r1.56 --- src/usr.bin/compress/main.c 2004/07/29 04:07:44 1.55 +++ src/usr.bin/compress/main.c 2004/09/20 18:53:20 1.56 @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.55 2004/07/29 04:07:44 millert Exp $ */ +/* $OpenBSD: main.c,v 1.56 2004/09/20 18:53:20 millert Exp $ */ #ifndef SMALL static const char copyright[] = @@ -36,7 +36,7 @@ #endif /* SMALL */ #ifndef SMALL -static const char main_rcsid[] = "$OpenBSD: main.c,v 1.55 2004/07/29 04:07:44 millert Exp $"; +static const char main_rcsid[] = "$OpenBSD: main.c,v 1.56 2004/09/20 18:53:20 millert Exp $"; #endif #include @@ -349,7 +349,8 @@ */ /* XXX - is overwriting fts_statp legal? (millert) */ if (entry->fts_errno == ENOENT && - strchr(entry->fts_accpath, '.') == NULL && + ((p = strrchr(entry->fts_accpath, '.')) == NULL || + strcmp(p, suffix) != 0) && snprintf(_infile, sizeof(_infile), "%s%s", infile, suffix) < sizeof(_infile) && stat(_infile, entry->fts_statp) == 0 &&