From 9bdb7e3f3d8fb762919e6d55aaea5e7263dd970d Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Mon, 13 Nov 2006 01:11:22 -0500 Subject: snapshot of project "lynx", label v2-8-7dev_3 --- src/LYGetFile.c | 40 ++++------------------------------------ 1 file changed, 4 insertions(+), 36 deletions(-) (limited to 'src/LYGetFile.c') 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); -- cgit 1.4.1-2-gfad0