From owner-cvs-contrib Sun Oct 12 05:51:26 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id FAA19095 for cvs-contrib-outgoing; Sun, 12 Oct 1997 05:51:26 -0700 (PDT) (envelope-from owner-cvs-contrib) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id FAA18870; Sun, 12 Oct 1997 05:47:45 -0700 (PDT) (envelope-from peter@FreeBSD.org) From: Peter Wemm Received: (from peter@localhost) by freefall.freebsd.org (8.8.6/8.8.5) id FAA05942; Sun, 12 Oct 1997 05:47:07 -0700 (PDT) Date: Sun, 12 Oct 1997 05:47:07 -0700 (PDT) Message-Id: <199710121247.FAA05942@freefall.freebsd.org> To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-contrib@FreeBSD.ORG Subject: cvs commit: src/contrib/cvs/src recurse.c Sender: owner-cvs-contrib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk peter 1997/10/12 05:47:07 PDT Modified files: contrib/cvs/src recurse.c Log: Fix a serious bug in the recursion processor. When descending a tree, the descend can jump several directories down in one hit, eg: when a user mentions multiple directories on the command line, eg: "cvs diff sys/i386/isa/snd sys/sys". The problem is that the chdir()s are pushed/popped to account for this, but the "full path" merely has the last component chopped off on the way back up. This busts lots of things when the recursion is backing up more than one directory (such as in the example). This causes 'cvs diff' to emit bogus Index: lines, 'cvs update' to do really stupid things, 'cvs commit' to record incorrect pathnames etc. I'm not sure that what I've done is quite correct, there seems to be a comment that implies some sort of problem with "." vs. "" equivalence or not, perhaps this is a problem on some other OS's, but I've not (yet) found any problems. This bug has been present since at least cvs-1.8.1. This should fix problems noted by several people including asami and jmg. Revision Changes Path 1.2 +280 -164 src/contrib/cvs/src/recurse.c