aboutsummaryrefslogtreecommitdiff
path: root/src/self.c
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2025-11-18 06:57:14 -0500
committerB. Watson <urchlay@slackware.uk>2025-11-18 06:57:14 -0500
commitebfad791508af77f7f8e942c88a6f5dc88bd6d41 (patch)
treec4414ef1e0fccc49c261dd5305dcdfb2feb53efc /src/self.c
parent7ec4a5150710643e99f982b5a82f8aeb49302d81 (diff)
downloadunalf-ebfad791508af77f7f8e942c88a6f5dc88bd6d41.tar.gz
Improve alfsum usage a bit.
Diffstat (limited to 'src/self.c')
-rw-r--r--src/self.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/self.c b/src/self.c
new file mode 100644
index 0000000..298608a
--- /dev/null
+++ b/src/self.c
@@ -0,0 +1,13 @@
+#include "unalf.h"
+
+char *self;
+
+void set_self(char *argv0) {
+ char *p;
+
+ self = argv0;
+ p = strrchr(self, '/');
+ if(!p) p = strrchr(self, '\\'); // windows exe needs this
+ if(p) self = p + 1;
+}
+