From 21617b7377fd55c2cc2f9c9966bb7b9108018772 Mon Sep 17 00:00:00 2001 From: Andre Pang Date: Tue, 22 Jun 2004 14:31:40 +0000 Subject: 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 --- src/input/input_file.c | 20 +++++++++++++++++--- 1 file 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); -- cgit v1.2.3