summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Pang <athp@users.sourceforge.net>2004-06-22 14:31:40 +0000
committerAndre Pang <athp@users.sourceforge.net>2004-06-22 14:31:40 +0000
commit21617b7377fd55c2cc2f9c9966bb7b9108018772 (patch)
tree82758872a4488321c48fdb2dbb18740fabb9823e
parentb38dfe3b7a23f993fd4d3997d436f9440d2ed648 (diff)
downloadxine-lib-21617b7377fd55c2cc2f9c9966bb7b9108018772.tar.gz
xine-lib-21617b7377fd55c2cc2f9c9966bb7b9108018772.tar.bz2
File input module now groks file://localhost/... and file://127.0.0.1/... MRLs
CVS patchset: 6731 CVS date: 2004/06/22 14:31:40
-rw-r--r--src/input/input_file.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/input/input_file.c b/src/input/input_file.c
index e09fc6716..0690f9bae 100644
--- a/src/input/input_file.c
+++ b/src/input/input_file.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_file.c,v 1.92 2004/06/13 21:28:56 miguelfreitas Exp $
+ * $Id: input_file.c,v 1.93 2004/06/22 14:31:40 athp Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -245,7 +245,14 @@ static int file_plugin_open (input_plugin_t *this_gen ) {
lprintf("file_plugin_open\n");
if (strncasecmp (this->mrl, "file:", 5) == 0)
- filename = decode_uri(&(this->mrl[5]));
+ {
+ if (strncasecmp (this->mrl, "file://localhost/", 16) == 0)
+ filename = decode_uri(&(this->mrl[16]));
+ else if (strncasecmp (this->mrl, "file://127.0.0.1/", 16) == 0)
+ filename = decode_uri(&(this->mrl[16]));
+ else
+ filename = decode_uri(&(this->mrl[5]));
+ }
else
filename = decode_uri(this->mrl);
@@ -257,7 +264,14 @@ static int file_plugin_open (input_plugin_t *this_gen ) {
/* try again without unescaping; such MRLs might be invalid,
* but we are a nice software */
if (strncasecmp (this->mrl, "file:", 5) == 0)
- this->fh = open(&this->mrl[5], O_RDONLY|O_BINARY);
+ {
+ if (strncasecmp (this->mrl, "file://localhost/", 16) == 0)
+ this->fh = open(&this->mrl[16], O_RDONLY|O_BINARY);
+ else if (strncasecmp (this->mrl, "file://127.0.0.1/", 16) == 0)
+ this->fh = open(&this->mrl[16], O_RDONLY|O_BINARY);
+ else
+ this->fh = open(&this->mrl[5], O_RDONLY|O_BINARY);
+ }
else
this->fh = open(this->mrl, O_RDONLY|O_BINARY);