Implemented regex and directories

This commit is contained in:
Nate Choe
2022-01-22 21:20:57 -06:00
parent fbb3a4e8cd
commit be8e081cca
4 changed files with 69 additions and 21 deletions

View File

@@ -216,8 +216,8 @@ Sitefile *parseFile(char *path) {
if (argc < 3)
goto error;
ret->content[ret->size].path = copyString(argv[1]);
if (ret->content[ret->size].path == NULL)
if (regcomp(&ret->content[ret->size].path, argv[1],
REG_EXTENDED | REG_NOSUB))
goto error;
if (strcmp(argv[0], "read") == 0) {
@@ -239,7 +239,7 @@ nterror:
void freeSitefile(Sitefile *site) {
for (long i = 0; i < site->size; i++) {
free(site->content[i].path);
regfree(&site->content[i].path);
free(site->content[i].arg);
}
free(site->content);