Marcus von Appen fixed bug 1529: CDROM detection misbehaviour for FreeBSD 7.x and newer SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Mon, 02 Jul 2012 08:29:57 -0400
branchSDL-1.2
changeset 6347 fdde82eb1ce3
parent 6325 9cff1c7c0fff
child 6353 dfcbd0d9209c
Marcus von Appen fixed bug 1529: CDROM detection misbehaviour for FreeBSD 7.x and newer FreeBSD's device naming changed in several ways since FreeBSD 6.x. The attached patch fixes the device naming scheme for FreeBSD 7 and newer (the currently supported upstream version of FreeBSD).
src/cdrom/freebsd/SDL_syscdrom.c
--- a/src/cdrom/freebsd/SDL_syscdrom.c	Sun Jun 03 05:03:45 2012 -0400
+++ b/src/cdrom/freebsd/SDL_syscdrom.c	Mon Jul 02 08:29:57 2012 -0400
@@ -188,7 +188,7 @@
 			char *insert;
 			exists = 1;
 			for ( j=checklist[i][1]; exists; ++j ) {
-				SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%sc", &checklist[i][3]);
+				SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", &checklist[i][3]);
 				insert = SDL_strchr(drive, '?');
 				if ( insert != NULL ) {
 					*insert = j;