From 85da7ee692072c643939e9f4b24fbd1e74e64e70 Mon Sep 17 00:00:00 2001 From: Akinori Ito Date: Thu, 15 Nov 2001 00:32:13 +0000 Subject: Update to w3m-0.2.1-inu-1.6. --- etc.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'etc.c') diff --git a/etc.c b/etc.c index c94f04a..d568f60 100644 --- a/etc.c +++ b/etc.c @@ -1,4 +1,4 @@ -/* $Id: etc.c,v 1.2 2001/11/09 04:59:17 a-ito Exp $ */ +/* $Id: etc.c,v 1.3 2001/11/15 00:32:13 a-ito Exp $ */ #include "fm.h" #include #include "myctype.h" @@ -1215,12 +1215,28 @@ char * file_to_url(char *file) { Str tmp; -#if defined( __CYGWIN__ ) || defined( __EMX__ ) +#ifdef SUPPORT_DOS_DRIVE_PREFIX char *drive = NULL; #endif +#ifdef SUPPORT_NETBIOS_SHARE + char *host = NULL; +#endif file = expandName(file); -#if defined( __CYGWIN__ ) || defined( __EMX__ ) +#ifdef SUPPORT_NETBIOS_SHARE + if (file[0] == '/' && file[1] == '/') { + char *p; + file += 2; + if (*file) { + p = strchr(file, '/'); + if (p != NULL && p != file) { + host = allocStr(file, (p - file)); + file = p; + } + } + } +#endif +#ifdef SUPPORT_DOS_DRIVE_PREFIX if (IS_ALPHA(file[0]) && file[1] == ':') { drive = allocStr(file, 2); file += 2; @@ -1234,7 +1250,11 @@ file_to_url(char *file) file = tmp->ptr; } tmp = Strnew_charp("file://"); -#if defined( __CYGWIN__ ) || defined( __EMX__ ) +#ifdef SUPPORT_NETBIOS_SHARE + if (host) + Strcat_charp(tmp, host); +#endif +#ifdef SUPPORT_DOS_DRIVE_PREFIX if (drive) Strcat_charp(tmp, drive); #endif -- cgit v1.2.3