version 1.14, 2004/07/30 17:39:27 |
version 1.15, 2004/07/31 01:13:41 |
|
|
cvs_file_getspec(char **fspec, int fsn, int flags) |
cvs_file_getspec(char **fspec, int fsn, int flags) |
{ |
{ |
int i, c; |
int i, c; |
char common[MAXPATHLEN]; |
char common[MAXPATHLEN], *cp; |
CVSFILE *cfp; |
CVSFILE *cfp; |
|
|
/* first find the common subdir */ |
|
strlcpy(common, fspec[0], sizeof(common)); |
|
for (i = 1; i < fsn; i++) { |
|
for (c = 0; ; c++) { |
|
if (common[c] != fspec[i][c]) { |
|
/* go back to last dir */ |
|
while ((c > 0) && (common[--c] != '/')) |
|
common[c] = '\0'; |
|
break; |
|
} |
|
} |
|
} |
|
if (*common == '\0') |
|
strlcpy(common, ".", sizeof(common)); |
|
|
|
/* first load the common subdirectory */ |
/* first load the common subdirectory */ |
cfp = cvs_file_get(common, flags); |
cfp = cvs_file_get(common, flags); |
for (i = 0; i < fsn; i++) { |
for (i = 0; i < fsn; i++) { |
|
|
} |
} |
|
|
cdp->cd_root = cvsroot_get(cf->cf_path); |
cdp->cd_root = cvsroot_get(cf->cf_path); |
printf("cvsroot = %s\n", cdp->cd_root->cr_str); |
|
if (cdp->cd_root == NULL) { |
if (cdp->cd_root == NULL) { |
cvs_file_freedir(cdp); |
cvs_file_freedir(cdp); |
return (-1); |
return (-1); |
|
|
cfp->cf_parent = parent; |
cfp->cf_parent = parent; |
|
|
if ((parent != NULL) && (CVS_DIR_ENTRIES(parent) != NULL)) { |
if ((parent != NULL) && (CVS_DIR_ENTRIES(parent) != NULL)) { |
ent = cvs_ent_get(CVS_DIR_ENTRIES(parent), path); |
ent = cvs_ent_get(CVS_DIR_ENTRIES(parent), cfp->cf_name); |
} |
} |
|
|
if (ent == NULL) |
if (ent == NULL) |
|
|
else |
else |
cfp->cf_cvstat = CVS_FST_MODIFIED; |
cfp->cf_cvstat = CVS_FST_MODIFIED; |
} |
} |
|
|
cvs_ent_free(ent); |
|
} |
} |
|
|
if ((cfp->cf_type == DT_DIR) && ((flags & CF_RECURSE) || cwd)) { |
if ((cfp->cf_type == DT_DIR) && ((flags & CF_RECURSE) || cwd)) { |