summaryrefslogtreecommitdiff
path: root/maje.c
diff options
context:
space:
mode:
Diffstat (limited to 'maje.c')
-rw-r--r--maje.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/maje.c b/maje.c
index 25ab155..3bbc5c0 100644
--- a/maje.c
+++ b/maje.c
@@ -1,4 +1,5 @@
#define _XOPEN_SOURCE 700
+#include <libgen.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
@@ -37,6 +38,7 @@ int main(int argc, char *argv[])
}
char *target = strdup(mainname);
target[strlen(target) - 2] = '\0';
+ target = basename(target);
FILE *makefile = fopen("Makefile", "w");
if (makefile == NULL) {