From: Francois B <mrs...@us...> - 2006-02-08 01:31:13
|
Update of /cvsroot/openneo/openneo/apps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7779 Modified Files: dj.c dj.h Log Message: changed a few char to unsigned char Index: dj.h =================================================================== RCS file: /cvsroot/openneo/openneo/apps/dj.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dj.h 6 Dec 2005 00:36:36 -0000 1.8 --- dj.h 8 Feb 2006 01:31:04 -0000 1.9 *************** *** 29,33 **** struct dj_command_entry { ! char path[256]; char cmd; char flags; --- 29,33 ---- struct dj_command_entry { ! unsigned char path[256]; char cmd; char flags; *************** *** 59,64 **** int dj_queue_track( const char* path, int pos ); int dj_queue_directory( char* dirpath, int pos ); ! int dj_queue_playlist( const char* path, int type, int pos ); ! int dj_fix_path( const char* bad_path, char* good_path, int max_length ); int dj_remove_playlist_track( int index ); --- 59,64 ---- int dj_queue_track( const char* path, int pos ); int dj_queue_directory( char* dirpath, int pos ); ! int dj_queue_playlist( const unsigned char* path, int type, int pos ); ! int dj_fix_path( const unsigned char* bad_path, unsigned char* good_path, int max_length ); int dj_remove_playlist_track( int index ); Index: dj.c =================================================================== RCS file: /cvsroot/openneo/openneo/apps/dj.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** dj.c 6 Dec 2005 00:40:40 -0000 1.15 --- dj.c 8 Feb 2006 01:31:04 -0000 1.16 *************** *** 781,790 **** } ! int dj_fix_path( const char* bad_path, char* good_path, int max_length ) { int i; ! const char* p; int len = 0; ! char buffer[MAX_PATH]; if( bad_path[0] == '/' || bad_path[0] == '\\' ) { //Path is already fine --- 781,790 ---- } ! int dj_fix_path( const unsigned char* bad_path, unsigned char* good_path, int max_length ) { int i; ! const unsigned char* p; int len = 0; ! unsigned char buffer[MAX_PATH]; if( bad_path[0] == '/' || bad_path[0] == '\\' ) { //Path is already fine *************** *** 796,800 **** while( *p && len < max_length) { ! if ( *p == '\\' ) good_path[len] = '/'; else --- 796,800 ---- while( *p && len < max_length) { ! if( *p == '\\' ) good_path[len] = '/'; else *************** *** 809,813 **** p = bad_path; ! while( *p ) { if( *p == '\\' ) --- 809,813 ---- p = bad_path; ! while( *p && len < MAX_PATH ) { if( *p == '\\' ) *************** *** 823,827 **** /* handle dos style drive letter */ ! if( buffer[1] == ':' ) { strncpy( good_path, &buffer[2], max_length ); len-=2; --- 823,827 ---- /* handle dos style drive letter */ ! if( buffer[1] == ':' && buffer[2] == '/' ) { strncpy( good_path, &buffer[2], max_length ); len-=2; *************** *** 954,962 **** }; ! static int callback_insert_path(char* line, int length, int line_nb, int offset, void *param) { struct read_callback_info *info = (struct read_callback_info *)param; ! char* path_start = line; ! char* path_end; struct dj_command_entry entry = {0}; int attrib; --- 954,962 ---- }; ! static int callback_insert_path(const unsigned char* line, int length, int line_nb, int offset, void *param) { struct read_callback_info *info = (struct read_callback_info *)param; ! unsigned char* path_start = line; ! unsigned char* path_end; struct dj_command_entry entry = {0}; int attrib; *************** *** 964,967 **** --- 964,972 ---- (void)offset; + if( length == 0 ) + return DJ_NOERROR; + + //msg_error( "%s", line ); + if( info->type == DIR_ATTR_WPL ) { *************** *** 984,988 **** dj_fix_path( path_start, entry.path, sizeof(entry.path) ); ! /* To validate the path, uncomment the next 2 lines */ //if( file_attributes( entry.path, &attrib ) ) // return DJ_NOERROR; --- 989,993 ---- dj_fix_path( path_start, entry.path, sizeof(entry.path) ); ! /* To validate the existence of the file, uncomment the next 2 lines */ //if( file_attributes( entry.path, &attrib ) ) // return DJ_NOERROR; *************** *** 1017,1021 **** yield(); ! //go to end of command file because of yield lseek(dj.fd, 0, SEEK_END); } --- 1022,1026 ---- yield(); ! //go to end of command file (yielding could have cause a fd pos change) lseek(dj.fd, 0, SEEK_END); } *************** *** 1024,1033 **** } ! int dj_queue_playlist( const char* path, int type, int pos ) { struct read_callback_info info; int ret = 0; int fd; ! char* pstr; --- 1029,1038 ---- } ! int dj_queue_playlist( const unsigned char* path, int type, int pos ) { struct read_callback_info info; int ret = 0; int fd; ! unsigned char* pstr; *************** *** 1086,1090 **** } - #ifdef VOICE int dj_play_voice_file( char* path ) { --- 1091,1094 ---- *************** *** 1093,1098 **** return 0; } - #endif - //int _truncate_playlist( int last_index ) --- 1097,1100 ---- |