*** bbcmk-old.c Tue Dec 31 17:22:37 2002 --- bbcmk.c Tue Dec 31 17:18:57 2002 *************** *** 1,5 **** --- 1,6 ---- #include #include + #include #include "common.h" char infile[256], outfile[256]; *************** *** 238,249 **** int next_track=directory[i].start_track; strcpy(working,argv[i+2]); ! strtok(working,"."); printf("Processing %s\n",working); inhandle=fopen( working, "r" ); if ( inhandle == 0 ) { ! printf( "Failed to open file %s\n", infile ); return 1; } /* Now read in the file 256 bytes at a time! */ --- 239,258 ---- int next_track=directory[i].start_track; strcpy(working,argv[i+2]); ! { // This code fragment added 26/11/02 by garmitage@swin.edu.au ! // to correctly remove the trailing ".inf" from each filename when ! // the app is called with .inf files as parameters ! char *p; ! p = strstr(working,".inf\0"); ! if (p!=NULL) *p=0; ! } ! // strtok(working,"."); // 26/11/02 gja This line was bogus if filenames included ".inf" printf("Processing %s\n",working); inhandle=fopen( working, "r" ); if ( inhandle == 0 ) { ! //printf( "Failed to open file %s\n", infile ); // removed 26/11/02 by gja ! printf( "Failed to open file %s\n", working ); return 1; } /* Now read in the file 256 bytes at a time! */ *************** *** 258,264 **** next_track=(next_sector==0)?next_track+1:next_track; filesize-=256; } ! fclose (inhandle); } fclose(outhandle); } --- 267,275 ---- next_track=(next_sector==0)?next_track+1:next_track; filesize-=256; } ! ! fclose (inhandle); ! } fclose(outhandle); }