1 diff -ru libdvdread-0.9.4/dvdread/bswap.h libdvdread/dvdread/bswap.h
2 --- libdvdread-0.9.4/dvdread/bswap.h 2002-12-15 01:09:12.000000000 +0100
3 +++ libdvdread/dvdread/bswap.h 2005-08-31 19:24:57.000000000 +0200
8 -#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(WIN32)
9 +#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(WIN32) || defined( __BEOS__ )
11 x = ((((x) & 0xff00) >> 8) | \
12 (((x) & 0x00ff) << 8))
13 diff -ru libdvdread-0.9.4/dvdread/dvd_reader.c libdvdread/dvdread/dvd_reader.c
14 --- libdvdread-0.9.4/dvdread/dvd_reader.c 2003-02-13 23:31:21.000000000 +0100
15 +++ libdvdread/dvdread/dvd_reader.c 2005-08-31 19:24:57.000000000 +0200
20 - ret = stat( path, &fileinfo );
22 + if( *path && (ret = stat( path, &fileinfo ) < 0) ) {
23 /* If we can't stat the file, give up */
24 fprintf( stderr, "libdvdread: Can't stat %s\n", path );
27 have_css = dvdinput_setup();
29 /* First check if this is a block/char device or a file*/
30 - if( S_ISBLK( fileinfo.st_mode ) ||
31 + if( !*path || S_ISBLK( fileinfo.st_mode ) ||
32 S_ISCHR( fileinfo.st_mode ) ||
33 S_ISREG( fileinfo.st_mode ) ) {
37 /* Resolve any symlinks and get the absolut dir name. */
41 - int cdir = open( ".", O_RDONLY );
45 + current_path = getcwd( NULL, PATH_MAX );
46 + if( current_path ) {
48 new_path = getcwd( NULL, PATH_MAX );
51 + chdir( current_path );
52 + free( current_path );
58 sprintf( filename, "%s%s%s", path,
59 ( ( path[ strlen( path ) - 1 ] == '/' ) ? "" : "/" ),