14a15,17 > /* ATH */ > #include > #include 652a656,659 > /* ATH */ > char *env; > struct stat sts; > 679a687,706 > /* ATH - 26 January 2012 > * > * Check for the existence of the file name held in vm->filename. > * If it does not exist read the env variable RETROIMAGE and check for the existence of that file. > * If that does not exists exit with an error. > * > */ > > if ( ( stat( vm->filename, &sts) == -1 ) && errno == ENOENT ) { > // File doesn't exist, get the environment variable. > // > env = (char *)getenv("RETROIMAGE"); > if( !env ) { > fprintf(stderr,"No image file and environment variable RETROIMAGE not set.\n"); > exit(1); > } else { > strncpy(vm->filename, env,sizeof(vm->filename)); > fprintf(stderr,"Loading image from %s\n", env); > } > }