[Mplayer-cvslog] CVS: main url.c,1.2,1.3

Bertrand Baudet bertrand at users.sourceforge.net
Fri May 25 15:57:20 CEST 2001


Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv26643

Modified Files:
	url.c 
Log Message:
Url given without a filename/path get the filename/path '/'


Index: url.c
===================================================================
RCS file: /cvsroot/mplayer/main/url.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** url.c	2001/05/20 12:42:14	1.2
--- url.c	2001/05/25 13:57:18	1.3
***************
*** 79,89 ****
  		if( strlen(ptr2)>1 ) {
  			// copy the path/filename in the URL container
! 			Curl->file = (char*)malloc(strlen(ptr2));
  			if( Curl->file==NULL ) {
  				printf("Memory allocation failed!\n");
  				exit(1);
  			}
! 			strcpy(Curl->file, ptr2+1);
  		}
  	}
  	
--- 79,99 ----
  		if( strlen(ptr2)>1 ) {
  			// copy the path/filename in the URL container
! 			Curl->file = (char*)malloc(strlen(ptr2)+1);
  			if( Curl->file==NULL ) {
  				printf("Memory allocation failed!\n");
  				exit(1);
  			}
! 			Curl->file[0]='/';
! 			strcpy(Curl->file+1, ptr2+1);
  		}
+ 	} 
+ 	// Check if a filenme was given or set else set it with '/'
+ 	if( Curl->file==NULL ) {
+ 		Curl->file = (char*)malloc(2);
+ 		if( Curl->file==NULL ) {
+ 			printf("Memory allocation failed!\n");
+ 			exit(1);
+ 		}
+ 		strcpy(Curl->file, "/");
  	}
  	


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list