version 1.171, 2017/06/01 08:08:24 |
version 1.172, 2020/10/19 19:51:20 |
|
|
struct module_checkout *mc; |
struct module_checkout *mc; |
struct cvs_ignpat *ip; |
struct cvs_ignpat *ip; |
struct cvs_filelist *fl, *nxt; |
struct cvs_filelist *fl, *nxt; |
char repo[PATH_MAX], fpath[PATH_MAX], *f[1]; |
char repo[PATH_MAX], fpath[PATH_MAX], path[PATH_MAX], *f[1]; |
|
|
build_dirs = print_stdout ? 0 : 1; |
build_dirs = print_stdout ? 0 : 1; |
|
|
|
|
cr.flags = flags; |
cr.flags = flags; |
|
|
if (!(mc->mc_flags & MODULE_ALIAS)) { |
if (!(mc->mc_flags & MODULE_ALIAS)) { |
|
if (strlcpy(path, fl->file_path, |
|
sizeof(path)) >= sizeof(path)) |
|
fatal("%s: truncation", |
|
__func__); |
module_repo_root = |
module_repo_root = |
xstrdup(dirname(fl->file_path)); |
xstrdup(dirname(path)); |
d = wdir; |
d = wdir; |
|
if (strlcpy(path, fl->file_path, |
|
sizeof(path)) >= sizeof(path)) |
|
fatal("%s: truncation", |
|
__func__); |
(void)xsnprintf(fpath, sizeof(fpath), |
(void)xsnprintf(fpath, sizeof(fpath), |
"%s/%s", d, |
"%s/%s", d, basename(path)); |
basename(fl->file_path)); |
|
} else { |
} else { |
d = dirname(wdir); |
if (strlcpy(path, wdir, |
|
sizeof(path)) >= sizeof(path)) |
|
fatal("%s: truncation", |
|
__func__); |
|
d = dirname(path); |
strlcpy(fpath, fl->file_path, |
strlcpy(fpath, fl->file_path, |
sizeof(fpath)); |
sizeof(fpath)); |
} |
} |
|
|
static int |
static int |
checkout_classify(const char *repo, const char *arg) |
checkout_classify(const char *repo, const char *arg) |
{ |
{ |
char *d, *f, fpath[PATH_MAX]; |
char *d, dbuf[PATH_MAX], *f, fbuf[PATH_MAX], fpath[PATH_MAX]; |
struct stat sb; |
struct stat sb; |
|
|
if (stat(repo, &sb) == 0) { |
if (stat(repo, &sb) == 0) { |
|
|
return CVS_DIR; |
return CVS_DIR; |
} |
} |
|
|
d = dirname(repo); |
if (strlcpy(dbuf, repo, sizeof(dbuf)) >= sizeof(dbuf)) |
f = basename(repo); |
fatal("checkout_classify: truncation"); |
|
d = dirname(dbuf); |
|
|
|
if (strlcpy(fbuf, repo, sizeof(fbuf)) >= sizeof(fbuf)) |
|
fatal("checkout_classify: truncation"); |
|
f = basename(fbuf); |
|
|
(void)xsnprintf(fpath, sizeof(fpath), "%s/%s%s", d, f, RCS_FILE_EXT); |
(void)xsnprintf(fpath, sizeof(fpath), "%s/%s%s", d, f, RCS_FILE_EXT); |
if (stat(fpath, &sb) == 0) { |
if (stat(fpath, &sb) == 0) { |