Update to w3m-0.2.1-inu-1.6.

This commit is contained in:
Akinori Ito
2001-11-15 00:32:13 +00:00
parent 6c63633545
commit 85da7ee692
82 changed files with 10900 additions and 217 deletions

28
etc.c
View File

@@ -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