- CmdInit (&CC65, "cc65");
- CmdInit (&CA65, "ca65");
- CmdInit (&CO65, "co65");
- CmdInit (&LD65, "ld65");
- CmdInit (&GRC, "grc65");
+ if (argc == 0) {
+ CmdPath = xstrdup ("");
+ } else {
+ char* Ptr;
+ CmdPath = xstrdup (argv[0]);
+ Ptr = strrchr (CmdPath, '/');
+ if (Ptr == 0) {
+ Ptr = strrchr (CmdPath, '\\');
+ }
+ if (Ptr == 0) {
+ *CmdPath = '\0';
+ } else {
+ *(Ptr + 1) = '\0';
+ }
+ }
+ CmdInit (&CC65, CmdPath, "cc65");
+ CmdInit (&CA65, CmdPath, "ca65");
+ CmdInit (&CO65, CmdPath, "co65");
+ CmdInit (&LD65, CmdPath, "ld65");
+ CmdInit (&GRC, CmdPath, "grc65");
+ xfree (CmdPath);