50 lines
1.1 KiB
Text
50 lines
1.1 KiB
Text
$NetBSD: patch-al,v 1.1 2006/07/29 20:40:09 dillo Exp $
|
|
|
|
--- src/gens/emulator/parse.c.orig 2004-05-19 21:21:00.000000000 +0200
|
|
+++ src/gens/emulator/parse.c
|
|
@@ -510,10 +510,41 @@ parseArgs (int argc, char **argv)
|
|
|
|
if (optind < argc)
|
|
{
|
|
- printf ("non-option ARGV-elements: ");
|
|
- while (optind < argc)
|
|
- printf ("%s ", argv[optind++]);
|
|
- printf ("\n");
|
|
+ if (optind == argc-1)
|
|
+ {
|
|
+ char fname[1024];
|
|
+ int l;
|
|
+
|
|
+ if (argv[optind][0] == '/')
|
|
+ {
|
|
+ strncpy(fname, argv[optind], 1024);
|
|
+ fname[1023] = '\0';
|
|
+ }
|
|
+ else
|
|
+ {
|
|
+ getcwd(fname, 1024);
|
|
+ fname[1023] = '\0';
|
|
+ l = strlen(fname);
|
|
+ fname[l++] = '/';
|
|
+ strncpy(fname+l, argv[optind], 1024-l);
|
|
+ fname[1023] = '\0';
|
|
+ }
|
|
+ if (Pre_Load_Rom(fname))
|
|
+ {
|
|
+ printf("%s loaded.\n", fname);
|
|
+ }
|
|
+ else
|
|
+ {
|
|
+ printf("cannot load %s.\n", fname);
|
|
+ }
|
|
+ }
|
|
+ else
|
|
+ {
|
|
+ printf ("non-option ARGV-elements: ");
|
|
+ while (optind < argc)
|
|
+ printf ("%s ", argv[optind++]);
|
|
+ printf ("\n");
|
|
+ }
|
|
}
|
|
}
|
|
|