Browse Source

* src/source/files.c : inline list_append()

master
Alex 'AdUser' Z 8 years ago
parent
commit
3201c949c5
  1. 16
      src/sources/files.c

16
src/sources/files.c

@ -101,15 +101,6 @@ file_getline(const f2b_file_t *file, char *buf, size_t bufsize) {
return false;
}
static f2b_file_t *
list_append(f2b_file_t *list, f2b_file_t *file) {
assert(file != NULL);
if (list != NULL)
return file->next = list;
return file;
}
static f2b_file_t *
list_from_glob(const char *pattern) {
f2b_file_t *file = NULL;
@ -129,7 +120,12 @@ list_from_glob(const char *pattern) {
free(file);
continue;
}
files = list_append(files, file);
if (files != NULL) {
file->next = files;
files = file;
} else {
files = file;
}
}
globfree(&globbuf);

Loading…
Cancel
Save