aboutsummaryrefslogtreecommitdiffstats
path: root/src/blogc-make/main.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2017-03-03 01:10:35 +0100
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2017-03-03 01:10:35 +0100
commit0c290f72a9101c196031c3bcf5ee1340b4328b80 (patch)
tree4ac5e096ffc79afbd830b6c478646f355e1156b8 /src/blogc-make/main.c
parentbe39aad967f2243dd512ae9ab9510179d13abf16 (diff)
downloadblogc-0c290f72a9101c196031c3bcf5ee1340b4328b80.tar.gz
blogc-0c290f72a9101c196031c3bcf5ee1340b4328b80.tar.bz2
blogc-0c290f72a9101c196031c3bcf5ee1340b4328b80.zip
make: reworked binary lookups, added them to ctx
Diffstat (limited to 'src/blogc-make/main.c')
-rw-r--r--src/blogc-make/main.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/blogc-make/main.c b/src/blogc-make/main.c
index c27c302..96f55b9 100644
--- a/src/blogc-make/main.c
+++ b/src/blogc-make/main.c
@@ -19,10 +19,6 @@
#include "ctx.h"
#include "rules.h"
-// is this beautiful? no. but there's no point in passing something that is
-// essentially global to every function in exec.c
-const char *argv0 = NULL;
-
static void
print_help(void)
@@ -61,11 +57,6 @@ main(int argc, char **argv)
{
setlocale(LC_ALL, "");
- // i really hope that no operating system omits argv[0], but ...
- if (argc > 0) {
- argv0 = argv[0];
- }
-
int rv = 0;
bc_error_t *err = NULL;
@@ -114,7 +105,8 @@ main(int argc, char **argv)
rules = bc_slist_append(rules, bc_strdup("all"));
}
- ctx = bm_ctx_new(NULL, blogcfile ? blogcfile : "blogcfile", &err);
+ ctx = bm_ctx_new(NULL, blogcfile ? blogcfile : "blogcfile",
+ argc > 0 ? argv[0] : NULL, &err);
if (err != NULL) {
bc_error_print(err, "blogc-make");
rv = 3;