version 1.31, 2006/04/05 01:38:56 |
version 1.32, 2006/05/27 03:30:31 |
|
|
#include "log.h" |
#include "log.h" |
#include "proto.h" |
#include "proto.h" |
|
|
|
|
extern char *cvs_rootstr; |
extern char *cvs_rootstr; |
|
|
|
|
/* keep these ordered with the defines */ |
/* keep these ordered with the defines */ |
const char *cvs_methods[] = { |
const char *cvs_methods[] = { |
"", |
"", |
|
|
fatal("no path specification in CVSROOT"); |
fatal("no path specification in CVSROOT"); |
|
|
root->cr_dir = sp; |
root->cr_dir = sp; |
|
STRIP_SLASH(root->cr_dir); |
if (sp == cp) { |
if (sp == cp) { |
if (root->cr_method == CVS_METHOD_NONE) |
if (root->cr_method == CVS_METHOD_NONE) |
root->cr_method = CVS_METHOD_LOCAL; |
root->cr_method = CVS_METHOD_LOCAL; |
|
|
if ((rootstr = getenv("CVSROOT")) != NULL) |
if ((rootstr = getenv("CVSROOT")) != NULL) |
return cvsroot_parse(rootstr); |
return cvsroot_parse(rootstr); |
else |
else |
fatal("cvsroot_get: empty CVSROOT variable"); |
return (NULL); |
} else { |
} else { |
fatal("cvsroot_get: fopen: `%s': %s", |
fatal("cvsroot_get: fopen: `%s': %s", |
CVS_PATH_ROOTSPEC, strerror(errno)); |
CVS_PATH_ROOTSPEC, strerror(errno)); |
|
|
|
|
len = strlen(line); |
len = strlen(line); |
if (len == 0) |
if (len == 0) |
cvs_log(LP_WARN, "empty %s file", CVS_PATH_ROOTSPEC); |
cvs_log(LP_ERR, "empty %s file", CVS_PATH_ROOTSPEC); |
else if (line[len - 1] == '\n') |
else if (line[len - 1] == '\n') |
line[--len] = '\0'; |
line[--len] = '\0'; |
|
|