atari: cdrom: Return an empty list of drives, instead of error if no driver present. SDL-1.2
authorPatrice Mandin <patmandin@gmail.com>
Fri, 27 Mar 2015 23:32:20 +0100
branchSDL-1.2
changeset 9446 d7de8d4232c4
parent 9426 c238763e1228
child 9564 b87c22915505
atari: cdrom: Return an empty list of drives, instead of error if no driver present.
src/cdrom/mint/SDL_syscdrom.c
--- a/src/cdrom/mint/SDL_syscdrom.c	Mon Mar 23 20:11:18 2015 -0400
+++ b/src/cdrom/mint/SDL_syscdrom.c	Fri Mar 27 23:32:20 2015 +0100
@@ -20,6 +20,7 @@
     slouken@libsdl.org
 */
 #include "SDL_config.h"
+#include "SDL_stdinc.h"
 
 #ifdef SDL_CDROM_MINT
 
@@ -75,23 +76,24 @@
 	int i, handle;
 	struct cdrom_subchnl info;
 
+	SDL_numcds = 0;
+	SDL_memset(metados_drives, 0, sizeof(metados_drives));
+
 	Metainit(&metainit);
 	if (metainit.version == NULL) {
 #ifdef DEBUG_CDROM
 		fprintf(stderr, "MetaDOS not installed\n");
 #endif
-		return -1;
+		return 0;
 	}
 
 	if (metainit.drives_map == 0) {
 #ifdef DEBUG_CDROM
 		fprintf(stderr, "No MetaDOS devices present\n");
 #endif
-		return -1;
+		return 0;
 	}
 
-	SDL_numcds = 0;
-	
 	for (i='A'; i<='Z'; i++) {
 		metados_drives[SDL_numcds].device[0] = 0;
 		metados_drives[SDL_numcds].device[1] = ':';