Marcus von Appen fixed bug 1529: CDROM detection misbehaviour for FreeBSD 7.x and newer SDL-1.2
authorSam Lantinga
Mon, 02 Jul 2012 08:29:57 -0400
branchSDL-1.2
changeset 6347fdde82eb1ce3
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
     1.1 --- a/src/cdrom/freebsd/SDL_syscdrom.c	Sun Jun 03 05:03:45 2012 -0400
     1.2 +++ b/src/cdrom/freebsd/SDL_syscdrom.c	Mon Jul 02 08:29:57 2012 -0400
     1.3 @@ -188,7 +188,7 @@
     1.4  			char *insert;
     1.5  			exists = 1;
     1.6  			for ( j=checklist[i][1]; exists; ++j ) {
     1.7 -				SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%sc", &checklist[i][3]);
     1.8 +				SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", &checklist[i][3]);
     1.9  				insert = SDL_strchr(drive, '?');
    1.10  				if ( insert != NULL ) {
    1.11  					*insert = j;