diff options
| author | B. Watson <urchlay@slackware.uk> | 2025-11-18 06:57:14 -0500 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2025-11-18 06:57:14 -0500 |
| commit | ebfad791508af77f7f8e942c88a6f5dc88bd6d41 (patch) | |
| tree | c4414ef1e0fccc49c261dd5305dcdfb2feb53efc /src/self.c | |
| parent | 7ec4a5150710643e99f982b5a82f8aeb49302d81 (diff) | |
| download | unalf-ebfad791508af77f7f8e942c88a6f5dc88bd6d41.tar.gz | |
Improve alfsum usage a bit.
Diffstat (limited to 'src/self.c')
| -rw-r--r-- | src/self.c | 13 |
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; +} + |
