Skip to content

Commit

Permalink
combined approach works, bring back getopt -a -l
Browse files Browse the repository at this point in the history
tested on OSX and Debian arm64
  • Loading branch information
jquast committed Jul 24, 2023
1 parent 7c2ad7e commit d03c721
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
Binary file modified demos/lovebyte_turbo22/planet/planet.bas
Binary file not shown.
Binary file modified music/still_alive/title.bas
Binary file not shown.
16 changes: 13 additions & 3 deletions utils/dos33fs-utils/dos33.c
Original file line number Diff line number Diff line change
Expand Up @@ -1062,13 +1062,22 @@ int main(int argc, char **argv) {
int retval=0;

/* Check command line arguments */
while ((c = getopt (argc, argv,"t:s:dhvxy"))!=-1) {
while ((c = getopt (argc, argv,"a:l:t:s:dhvxy"))!=-1) {
switch (c) {

case 'd':
fprintf(stderr,"DEBUG enabled\n");
debug=1;
break;
case 'a':
address=strtol(optarg,&endptr,0);
if (debug) fprintf(stderr,"Address=%d\n",address);
break;
case 'l':
length=strtol(optarg,&endptr,0);
if (debug) fprintf(stderr,"Length=%d\n",length);
break;

#if 0
case 't':
track=strtol(optarg,&endptr,0);
Expand Down Expand Up @@ -1233,8 +1242,9 @@ int main(int argc, char **argv) {
goto exit_and_close;
}

// check for optional -a and -l argument in command BSAVE [-a addr] [-l len] local_file [apple_file],
// this is done here instead of through getopt(3), because getopt does not handle sub-arguments
// check for optional -a and -l argument in command BSAVE [-a addr] [-l len] local_file [apple_file],
// this is done here only for non-linux systems instead of going through getopt(3), where 'optind' is
// handleled differently
while(optind < argc) {
if (strcmp (argv[optind], "-a") == 0) {
if (optind + 2 > argc) {
Expand Down
Binary file modified vaporlock/tfv_credits/bishop.bas
Binary file not shown.
Binary file modified vaporlock/tfv_credits/rainbow.bas
Binary file not shown.

0 comments on commit d03c721

Please sign in to comment.