Skip to content

Commit

Permalink
VCC: Fix +glob with relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
walid-git committed Jan 7, 2025
1 parent 574c1f8 commit 889efb2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/libvcc/vcc_source.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,24 @@ vcc_include_glob_file(struct vcc *tl, const struct source *src_sp,
const char *filename, const struct token *parent_token)
{
glob_t g[1];
char **paths, **p;
unsigned u;
int i;

if (filename[0] != '/') {
paths = VFIL_concat(tl->vcl_path, filename);
p = paths;
while (*p != NULL) {
assert(*p[0] == '/');
vcc_include_glob_file(tl, src_sp, *p, parent_token);
free(*p);
*p = NULL;
p++;
}
free(paths);
return;
}

memset(g, 0, sizeof g);
i = glob(filename, 0, NULL, g);
switch (i) {
Expand Down

0 comments on commit 889efb2

Please sign in to comment.