summaryrefslogtreecommitdiffstats
path: root/src/whatfiles.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/whatfiles.c')
-rw-r--r--src/whatfiles.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/whatfiles.c b/src/whatfiles.c
index fb9f291..0004308 100644
--- a/src/whatfiles.c
+++ b/src/whatfiles.c
@@ -1,4 +1,5 @@
#include <dirent.h>
+#include <regex.h>
#include <signal.h>
#include <stddef.h>
#include <string.h>
@@ -14,6 +15,7 @@
FILE *Handle = (FILE*)NULL;
int Debug = 0;
+regex_t regex;
LastSyscall_t LastSyscall;
DebugStats_t DebugStats;
@@ -92,6 +94,10 @@ int main(int argc, char* argv[])
HashMap hashmap = &hm;
init_hashmap(hashmap);
+ if (regcomp(&regex, "State:\\W+([A-Za-z])", REG_EXTENDED) != 0) {
+ SYS_ERR("regex compilation error");
+ }
+
int start_of_user_command = discover_flags(argc, argv);
char *user_filename = parse_flags(start_of_user_command, argv, &pid, &stdout_override, &attach);
if (start_of_user_command == argc && !attach) {
@@ -210,6 +216,7 @@ int main(int argc, char* argv[])
}
}
+ regfree(&regex);
err = destroy(hashmap);
HASH_ERR_CHECK(err, "tried to free null pointers in hashmap.\n")
fclose(Handle);