[Mplayer-cvslog] CVS: main url.c,1.4,1.5
Bertrand Baudet
bertrand at users.sourceforge.net
Mon Jun 4 19:47:45 CEST 2001
Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv16530
Modified Files:
url.c
Log Message:
Modified code for path/filename extraction.
Index: url.c
===================================================================
RCS file: /cvsroot/mplayer/main/url.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** url.c 2001/05/29 16:58:52 1.4
--- url.c 2001/06/04 17:47:43 1.5
***************
*** 40,44 ****
ptr1 = strstr(url, "://");
if( ptr1==NULL ) {
! printf("Malformed URL or not an URL!\n");
return NULL;
}
--- 40,44 ----
ptr1 = strstr(url, "://");
if( ptr1==NULL ) {
! printf("Not an URL!\n");
return NULL;
}
***************
*** 69,73 ****
}
// copy the hostname in the URL container
! Curl->hostname = (char*)malloc(strlen(url)+1);
if( Curl->hostname==NULL ) {
printf("Memory allocation failed!\n");
--- 69,73 ----
}
// copy the hostname in the URL container
! Curl->hostname = (char*)malloc(pos2-pos1-3+1);
if( Curl->hostname==NULL ) {
printf("Memory allocation failed!\n");
***************
*** 89,97 ****
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);
--- 89,96 ----
exit(1);
}
! strcpy(Curl->file, ptr2);
}
}
! // Check if a filenme was given or set, else set it with '/'
if( Curl->file==NULL ) {
Curl->file = (char*)malloc(2);
_______________________________________________
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