aboutsummaryrefslogtreecommitdiffstats
path: root/etc.c
diff options
context:
space:
mode:
authorAkinori Ito <aito@eie.yz.yamagata-u.ac.jp>2001-11-15 00:32:13 +0000
committerAkinori Ito <aito@eie.yz.yamagata-u.ac.jp>2001-11-15 00:32:13 +0000
commit85da7ee692072c643939e9f4b24fbd1e74e64e70 (patch)
tree9fc63298cf968fa560a9e3cf9b6c84516032fca8 /etc.c
parentUpdates from 0.2.1 into 0.2.1-inu-1.5 (diff)
downloadw3m-85da7ee692072c643939e9f4b24fbd1e74e64e70.tar.gz
w3m-85da7ee692072c643939e9f4b24fbd1e74e64e70.zip
Update to w3m-0.2.1-inu-1.6.
Diffstat (limited to '')
-rw-r--r--etc.c28
1 files changed, 24 insertions, 4 deletions
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 <pwd.h>
#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