version 1.113, 2005/08/14 19:49:18 |
version 1.114, 2005/08/17 08:35:53 |
|
|
* the <freecf> argument is passed to cvs_file_getdir, if this is 1 |
* the <freecf> argument is passed to cvs_file_getdir, if this is 1 |
* CVSFILE * structs will be free'd once we are done with them. |
* CVSFILE * structs will be free'd once we are done with them. |
*/ |
*/ |
CVSFILE * |
CVSFILE * |
cvs_file_loadinfo(char *path, int flags, int (*cb)(CVSFILE *, void *), |
cvs_file_loadinfo(char *path, int flags, int (*cb)(CVSFILE *, void *), |
void *arg, int freecf) |
void *arg, int freecf) |
{ |
{ |
|
|
|
|
/* |
/* |
* No Entry available? fall back to stat(2)'ing the item, if |
* No Entry available? fall back to stat(2)'ing the item, if |
* that fails, assume a normal file. |
* that fails, assume a normal file. |
*/ |
*/ |
if (ent == NULL) { |
if (ent == NULL) { |
if (stat(path, &st) == -1) |
if (stat(path, &st) == -1) |
|
|
return (0); |
return (0); |
return (-1); |
return (-1); |
} |
} |
|
|
/* if the CVS administrative directory exists, load the info */ |
/* if the CVS administrative directory exists, load the info */ |
l = snprintf(pbuf, sizeof(pbuf), "%s/" CVS_PATH_CVSDIR, fpath); |
l = snprintf(pbuf, sizeof(pbuf), "%s/" CVS_PATH_CVSDIR, fpath); |
if (l == -1 || l >= (int)sizeof(pbuf)) { |
if (l == -1 || l >= (int)sizeof(pbuf)) { |