[A fix was checked in by Noel Cragg on 17 Feb 1998, with fixes to the fix checked in by Jim Kingdon on 16 Apr 1998. This file contains two messages, an initial report of the problem, and a patch from Jeff Johnson. I'm guessing the bug was a result of Noel Cragg's 11 Oct 1997 change/rewrite to checkout.c. -kingdon] Date: Fri, 21 Nov 1997 18:09:11 -0500 From: Jim Kingdon To: devel-cvs@harvey.cyclic.com Subject: Problem with checkout cleanup What do you say Noel? I think "we" should fix it and I suspect the leading candidate for "we" is the one who (apparently) broke it.... Not that I have verified this or anything. Excerpt from bug-cvs: My last cvs (1.9.10) and all earlier versions would accept the command "cvs co -d /home/user/MyModName module" and my cvs scripts use this form. I just build 1.9.20 and the above command reports "cvs [checkout aborted]: cannot make directory : no such file or diretory". As of version 1.9.10 the user did not have to be in the directory where the files were being checked out. From: Jeff Johnson Subject: FIX: cvs get -d /abs/path ... To: bug-cvs@gnu.org Date: Thu, 12 Feb 1998 17:59:12 -0500 (EST) Hi -- Here's a (minimalistic) patch to restore the functionality of cvs get -d /usr/tmp/whatever module Index: checkout.c =================================================================== RCS file: /home2/cvsroot/ccvs/src/checkout.c,v retrieving revision 1.76 diff -u -r1.76 checkout.c --- checkout.c 1997/11/05 20:33:06 1.76 +++ checkout.c 1998/02/12 22:28:27 @@ -730,11 +730,20 @@ while (cp != NULL) { struct dir_to_build *new; + new = (struct dir_to_build *) xmalloc (sizeof (struct dir_to_build)); + new->repository = NULL; new->dirpath = xmalloc (strlen (where)); - strncpy (new->dirpath, where, cp - where); - new->dirpath[cp - where] = '\0'; + new->next = NULL; + + /* This copies a lonely '/' on last trip through with absolute path */ + { int nb = cp - where; + if (nb == 0) + nb = 1; + strncpy (new->dirpath, where, nb); + new->dirpath[nb] = '\0'; + } /* Now figure out what repository directory to generate. The most complete case would be something like this: @@ -756,7 +765,10 @@ { /* We can't walk up past CVSROOT. Instead, the repository should be Emptydir. */ - new->repository = emptydir_name (); + + /* XXX preserve algorithm for relative path */ + if (where[0] != '/') + new->repository = emptydir_name (); } else { @@ -1080,6 +1092,11 @@ while (dirs != NULL) { char *dir = last_component (dirs->dirpath); + + /* XXX restore lonely '/' */ + if (dir && dir[0] == '\0' && + dirs->dirpath[0] == '/' && dirs->dirpath[1] == '\0') + dir = "/"; mkdir_if_needed (dir); Subdir_Register (NULL, NULL, dir); 73 de Jeff -- Jeff Johnson ARS N3NPQ jbj@jbj.org Gaithersburg, MD