"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libutils/file_lib.c" between
cfengine-3.12.5.tar.gz and cfengine-3.12.6.tar.gz

About: CFEngine is a configuration management system for configuring and maintaining Unix-like computers (using an own high level policy language). Community version. LTS (Long Term Support) release.

file_lib.c  (cfengine-3.12.5):file_lib.c  (cfengine-3.12.6)
skipping to change at line 1436 skipping to change at line 1436
if ((*buff)[b - 1] == '\n') if ((*buff)[b - 1] == '\n')
{ {
(*buff)[b - 1] = '\0'; (*buff)[b - 1] = '\0';
b--; b--;
} }
} }
return b; return b;
} }
ssize_t CfReadLines(char **buff, size_t *size, FILE *fp, Seq *lines)
{
assert(size != NULL);
assert(fp != NULL);
assert(lines != NULL);
assert((buff != NULL) || *size == 0);
ssize_t appended = 0;
ssize_t ret;
bool free_buff = (buff == NULL);
while (!feof(fp))
{
assert((buff != NULL) || *size == 0);
ret = CfReadLine(buff, size, fp);
if (ret == -1)
{
if (!feof(fp))
{
if (free_buff)
{
free(*buff);
}
return -1;
}
}
else
{
SeqAppend(lines, xstrdup(*buff));
appended++;
}
}
if (free_buff)
{
free(*buff);
}
return appended;
}
StringSet* GlobFileList(const char *pattern) StringSet* GlobFileList(const char *pattern)
{ {
StringSet *set = StringSetNew(); StringSet *set = StringSetNew();
glob_t globbuf; glob_t globbuf;
int globflags = 0; // TODO: maybe add GLOB_BRACE later int globflags = 0; // TODO: maybe add GLOB_BRACE later
const char* r_candidates[] = { "*", "*/*", "*/*/*", "*/*/*/*", "*/*/*/*/*", "*/*/*/*/*/*" }; const char* r_candidates[] = { "*", "*/*", "*/*/*", "*/*/*/*", "*/*/*/*/*", "*/*/*/*/*/*" };
bool starstar = ( strstr(pattern, "**") != NULL ); bool starstar = ( strstr(pattern, "**") != NULL );
const char** candidates = starstar ? r_candidates : NULL; const char** candidates = starstar ? r_candidates : NULL;
const int candidate_count = starstar ? 6 : 1; const int candidate_count = starstar ? 6 : 1;
 End of changes. 1 change blocks. 
0 lines changed or deleted 40 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)