version 1.126, 2005/10/27 00:24:24 |
version 1.127, 2005/11/12 21:34:48 |
|
|
#include "cvs.h" |
#include "cvs.h" |
#include "file.h" |
#include "file.h" |
#include "log.h" |
#include "log.h" |
#include "strtab.h" |
|
|
|
#define CVS_IGN_STATIC 0x01 /* pattern is static, no need to glob */ |
#define CVS_IGN_STATIC 0x01 /* pattern is static, no need to glob */ |
|
|
|
|
CVSFILE *child; |
CVSFILE *child; |
|
|
if (cf->cf_name != NULL) |
if (cf->cf_name != NULL) |
cvs_strfree(cf->cf_name); |
free(cf->cf_name); |
|
|
if (cf->cf_dir != NULL) |
if (cf->cf_dir != NULL) |
cvs_strfree(cf->cf_dir); |
free(cf->cf_dir); |
|
|
if (cf->cf_type == DT_DIR) { |
if (cf->cf_type == DT_DIR) { |
if (cf->cf_root != NULL) |
if (cf->cf_root != NULL) |
|
|
} |
} |
} else { |
} else { |
if (cf->cf_tag != NULL) |
if (cf->cf_tag != NULL) |
cvs_strfree(cf->cf_tag); |
free(cf->cf_tag); |
if (cf->cf_opts != NULL) |
if (cf->cf_opts != NULL) |
cvs_strfree(cf->cf_opts); |
free(cf->cf_opts); |
} |
} |
|
|
free(cf); |
free(cf); |
|
|
SIMPLEQ_INIT(&(cfp->cf_files)); |
SIMPLEQ_INIT(&(cfp->cf_files)); |
} |
} |
|
|
cfp->cf_name = cvs_strdup(basename(path)); |
cfp->cf_name = strdup(basename(path)); |
if (cfp->cf_name == NULL) { |
if (cfp->cf_name == NULL) { |
cvs_log(LP_ERR, "failed to copy file name"); |
cvs_log(LP_ERR, "failed to copy file name"); |
cvs_file_free(cfp); |
cvs_file_free(cfp); |
|
|
if ((p = strrchr(path, '/')) != NULL) { |
if ((p = strrchr(path, '/')) != NULL) { |
*p = '\0'; |
*p = '\0'; |
if (strcmp(path, ".")) { |
if (strcmp(path, ".")) { |
cfp->cf_dir = cvs_strdup(path); |
cfp->cf_dir = strdup(path); |
if (cfp->cf_dir == NULL) { |
if (cfp->cf_dir == NULL) { |
cvs_log(LP_ERR, |
cvs_log(LP_ERR, |
"failed to copy directory"); |
"failed to copy directory"); |
|
|
|
|
if (ent->ce_type == CVS_ENT_FILE) { |
if (ent->ce_type == CVS_ENT_FILE) { |
if (ent->ce_tag[0] != '\0') { |
if (ent->ce_tag[0] != '\0') { |
cfp->cf_tag = cvs_strdup(ent->ce_tag); |
cfp->cf_tag = strdup(ent->ce_tag); |
if (cfp->cf_tag == NULL) { |
if (cfp->cf_tag == NULL) { |
cvs_file_free(cfp); |
cvs_file_free(cfp); |
return (NULL); |
return (NULL); |
|
|
} |
} |
|
|
if (ent->ce_opts[0] != '\0') { |
if (ent->ce_opts[0] != '\0') { |
cfp->cf_opts = cvs_strdup(ent->ce_opts); |
cfp->cf_opts = strdup(ent->ce_opts); |
if (cfp->cf_opts == NULL) { |
if (cfp->cf_opts == NULL) { |
cvs_file_free(cfp); |
cvs_file_free(cfp); |
return (NULL); |
return (NULL); |