mirror of
https://github.com/ksherlock/mpw.git
synced 2025-02-16 12:30:53 +00:00
basename the app name
This commit is contained in:
parent
00c83dce1a
commit
384b968a15
@ -6,6 +6,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <sysexits.h>
|
#include <sysexits.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
|
#include <libgen.h>
|
||||||
|
|
||||||
#include <CoreServices/CoreServices.h>
|
#include <CoreServices/CoreServices.h>
|
||||||
|
|
||||||
@ -239,13 +240,13 @@ void InitializeMPW(int argc, char **argv)
|
|||||||
|
|
||||||
// 0x0910 CurApName
|
// 0x0910 CurApName
|
||||||
{
|
{
|
||||||
|
// basename it.
|
||||||
// todo -- basename it.
|
char * name = basename(argv[0]);
|
||||||
char str32[32];
|
char str32[32];
|
||||||
int l = strlen(argv[0]);
|
int l = strlen(name);
|
||||||
l = std::min(l, 32);
|
l = std::min(l, 32);
|
||||||
str32[0] = l;
|
str32[0] = l;
|
||||||
memcpy(str32 + 1, argv[0], l);
|
memcpy(str32 + 1, name, l);
|
||||||
while (l < 32) str32[l++] = 0;
|
while (l < 32) str32[l++] = 0;
|
||||||
|
|
||||||
memcpy(Memory + 0x910, str32, 32);
|
memcpy(Memory + 0x910, str32, 32);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user