[w3m-dev 04024] fix: drive letter

WATANABE Katsuyuki <[email protected]>
Newsgroups gmane.comp.web.w3m.devel
Message-ID <[email protected]>
$BEOn5$G$9!#(B

Cygwin$B4D6-$G%I%i%$%V%l%?!<$r4^$`%m!<%+%k%Q%9$K%"%/%;%9$G$-$J$$(B
$B$H$$$&LdBj$,$"$j$^$7$?$N$G=$@5$G$9!#(B


--- url.c.orig	2003-11-09 13:14:02.000000000 +0900
+++ url.c	2003-11-15 00:36:35.000000000 +0900
@@ -1188,8 +1188,19 @@
 	}
 	return;
     }
-    if (pu->scheme == SCM_LOCAL)
-	pu->file = file_quote(expandName(file_unquote(pu->file)));
+    if (pu->scheme == SCM_LOCAL) {
+	char *q = expandName(file_unquote(pu->file));
+#ifdef SUPPORT_DOS_DRIVE_PREFIX
+	Str drive;
+	if (IS_ALPHA(q[0]) && q[1] == ':') {
+	    drive = Strnew_charp_n(q, 2);
+	    Strcat_charp(drive, file_quote(q+2));
+	    pu->file = drive->ptr;
+	}
+	else
+#endif
+	    pu->file = file_quote(q);
+    }
 
     if (current && (pu->scheme == current->scheme ||
 		    (pu->scheme == SCM_FTP && current->scheme == SCM_FTPDIR) ||
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.