about summary refs log tree commit diff stats
path: root/src/LYGetFile.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2006-11-13 01:11:22 -0500
committerThomas E. Dickey <dickey@invisible-island.net>2006-11-13 01:11:22 -0500
commit9bdb7e3f3d8fb762919e6d55aaea5e7263dd970d (patch)
tree5ca794151f77eca9b75b3c9ac8d51c29274cb0de /src/LYGetFile.c
parentf255f8da2e6a2a8b53639ea2264d5db3c3760b23 (diff)
downloadlynx-snapshots-9bdb7e3f3d8fb762919e6d55aaea5e7263dd970d.tar.gz
snapshot of project "lynx", label v2-8-7dev_3
Diffstat (limited to 'src/LYGetFile.c')
-rw-r--r--src/LYGetFile.c40
1 files changed, 4 insertions, 36 deletions
diff --git a/src/LYGetFile.c b/src/LYGetFile.c
index 248ffa17..b3429fa3 100644
--- a/src/LYGetFile.c
+++ b/src/LYGetFile.c
@@ -465,15 +465,9 @@ int getfile(DocInfo *doc, int *target)
 		/*
 		 * Convert '~' to $HOME.
 		 */
-		if ((cp = strchr(doc->address, '~'))) {
-		    HTSprintf0(&p, "%.*s%s%s",
-			       cp - doc->address,
-			       doc->address,
-			       wwwName(Home_Dir()),
-			       cp + 1);
-		} else {
-		    StrAllocCopy(p, doc->address);
-		}
+		StrAllocCopy(p, doc->address);
+		LYTildeExpand(&p, TRUE);
+
 		/*
 		 * Show URL before executing it.
 		 */
@@ -785,33 +779,7 @@ int getfile(DocInfo *doc, int *target)
 	     * was entered, simplifying, and eliminating any residual
 	     * relative elements.  - FM
 	     */
-	    if (((cp = HTParse(doc->address, "",
-			       PARSE_PATH + PARSE_ANCHOR + PARSE_PUNCTUATION))
-		 != NULL) &&
-		!strncmp(cp, "/~", 2)) {
-		char *cp1 = strstr(doc->address, "/~");
-		char *cp2;
-
-		CTRACE((tfp, "getfile: URL '%s'\n",
-			doc->address));
-		*cp1 = '\0';
-		cp1 += 2;
-		StrAllocCopy(temp, doc->address);
-		StrAllocCopy(cp, wwwName(Home_Dir()));
-		if (!LYIsHtmlSep(*cp))
-		    LYAddHtmlSep(&temp);
-		StrAllocCat(temp, cp);
-		if ((cp2 = strchr(cp1, '/')) != NULL) {
-		    LYTrimRelFromAbsPath(cp2);
-		    StrAllocCat(temp, cp2);
-		}
-		StrAllocCopy(doc->address, temp);
-		FREE(temp);
-		CTRACE((tfp, "  changed to '%s'\n",
-			doc->address));
-		WWWDoc.address = doc->address;
-	    }
-	    FREE(cp);
+	    LYTildeExpand(&(doc->address), TRUE);
 	}
 	CTRACE_SLEEP(MessageSecs);
 	user_message(WWW_WAIT_MESSAGE, doc->address);