diff options
author | bertrand <bertrand@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-05-29 16:58:52 +0000 |
---|---|---|
committer | bertrand <bertrand@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-05-29 16:58:52 +0000 |
commit | 84619a27693f89bc0124ff120204aefc0b3697cb (patch) | |
tree | deed5ccb179bd9e7bbe851e5132eef425b91f174 /url.c | |
parent | 3e437015c05a3a0e0931f5b6b14efef3c43bed9a (diff) | |
download | mpv-84619a27693f89bc0124ff120204aefc0b3697cb.tar.bz2 mpv-84619a27693f89bc0124ff120204aefc0b3697cb.tar.xz |
Bugs fix, improvements...
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@903 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'url.c')
-rw-r--r-- | url.c | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -1,3 +1,12 @@ +/* + * URL Helper + * by Bertrand Baudet <bertrand_baudet@yahoo.com> + * (C) 2001, MPlayer team. + * + * TODO: + * Extract the username/password if present + */ + #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -5,7 +14,7 @@ #include "url.h" URL_t* -set_url(char* url) { +url_new(char* url) { int pos1, pos2; URL_t* Curl; char *ptr1, *ptr2; @@ -17,11 +26,7 @@ set_url(char* url) { exit(1); } // Initialisation of the URL container members - Curl->url = NULL; - Curl->protocol = NULL; - Curl->hostname = NULL; - Curl->file = NULL; - Curl->port = 0; + memset( Curl, 0, sizeof(URL_t) ); // Copy the url in the URL container Curl->url = (char*)malloc(strlen(url)+1); @@ -101,11 +106,13 @@ set_url(char* url) { } void -free_url(URL_t* url) { +url_free(URL_t* url) { if(url) return; if(url->url) free(url->url); if(url->protocol) free(url->protocol); if(url->hostname) free(url->hostname); if(url->file) free(url->file); + if(url->username) free(url->username); + if(url->password) free(url->password); free(url); } |