diff options
author | June McEnroe <june@causal.agency> | 2021-09-30 02:46:34 +0000 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2021-09-30 02:46:34 +0000 |
commit | f22ce6351a2e86371ac7c9edcea39d250e35bf2d (patch) | |
tree | 6ca50789d1e80c9049e0c6da3d3a5e44ac94ba47 | |
parent | pledge(2) htagml (diff) | |
download | src-f22ce6351a2e86371ac7c9edcea39d250e35bf2d.tar.gz src-f22ce6351a2e86371ac7c9edcea39d250e35bf2d.zip |
pledge(2) mtags
-rw-r--r-- | bin/mtags.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/mtags.c b/bin/mtags.c index 282d9f03..5c1a057e 100644 --- a/bin/mtags.c +++ b/bin/mtags.c @@ -34,6 +34,7 @@ static void escape(FILE *file, const char *str, size_t len) { } int main(int argc, char *argv[]) { + int error; bool append = false; const char *path = "tags"; for (int opt; 0 < (opt = getopt(argc, argv, "af:"));) { @@ -47,10 +48,15 @@ int main(int argc, char *argv[]) { FILE *tags = fopen(path, (append ? "a" : "w")); if (!tags) err(EX_CANTCREAT, "%s", path); +#ifdef __OpenBSD__ + error = pledge("stdio rpath", NULL); + if (error) err(EX_OSERR, "pledge"); +#endif + regex_t makeFile, makeLine; regex_t mdocFile, mdocLine; regex_t shFile, shLine; - int error = 0 + error = 0 || regcomp(&makeFile, "(^|/)Makefile|[.]mk$", REG_EXTENDED | REG_NOSUB) || regcomp( &makeLine, |