1 diff -Naur libdvdread.orig/src/dvd_reader.c libdvdread/src/dvd_reader.c
2 --- libdvdread.orig/src/dvd_reader.c 2009-03-13 18:28:21.000000000 -0700
3 +++ libdvdread/src/dvd_reader.c 2009-09-15 10:15:25.201548319 -0700
6 /* misc win32 helpers */
9 #ifndef HAVE_GETTIMEOFDAY
10 /* replacement gettimeofday implementation */
11 #include <sys/timeb.h>
13 char *dev_name = NULL;
22 /* Try to open libdvdcss or fall back to standard functions */
23 have_css = dvdinput_setup();
27 /* Strip off the trailing \ if it is not a drive */
35 + if( strlen( path_copy ) > TITLES_MAX ) {
36 + if( !strcasecmp( &(path_copy[ strlen( path_copy ) - TITLES_MAX ]),
38 + path_copy[ strlen( path_copy ) - (TITLES_MAX-1) ] = '\0';
42 if( strlen( path_copy ) > TITLES_MAX ) {
43 if( !strcasecmp( &(path_copy[ strlen( path_copy ) - TITLES_MAX ]),
52 if( ( fe = getfsfile( path_copy ) ) ) {
57 -#elif defined(_MSC_VER) || defined(__OS2__)
58 - auth_drive = DVDOpenImageFile( path, have_css );
59 +#elif defined(_WIN32) || defined(__OS2__)
60 + if( GetDriveType( path_copy ) == DRIVE_CDROM ) {
61 + path_copy[2] = '\0';
62 + auth_drive = DVDOpenImageFile( path_copy, have_css );
66 -#if !defined(_MSC_VER) && !defined(__OS2__)
67 +#if !defined(_WIN32) && !defined(__OS2__)
69 fprintf( stderr, "libdvdread: Couldn't find device name.\n" );
70 } else if( !auth_drive ) {
71 diff -Naur libdvdread.orig/src/dvdread_internal.h libdvdread/src/dvdread_internal.h
72 --- libdvdread.orig/src/dvdread_internal.h 2008-10-03 13:11:30.000000000 -0700
73 +++ libdvdread/src/dvdread_internal.h 2009-09-15 09:44:01.788301485 -0700
75 #ifndef LIBDVDREAD_DVDREAD_INTERNAL_H
76 #define LIBDVDREAD_DVDREAD_INTERNAL_H
81 -#endif /* _MSC_VER */
84 #define CHECK_VALUE(arg) \