summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-10-11 13:00:19 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-10-11 13:00:19 +0300
commita99c7bd93212c3bfed5da847618021c8acac3709 (patch)
tree50b6271bab0d8700e53f43de2d24f0ee102cbdf2 /src
parent463174066a2490522afc9b4dc95efeffbc498354 (diff)
Fixed saving a page with a tilde in the filename
The tilde was assumed to be a home directory name, and therefore the name was considered to be an absolute path in itself.
Diffstat (limited to 'src')
-rw-r--r--src/ui/documentwidget.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 32120cff..1bc2ec12 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -1462,6 +1462,10 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd)
1462 setRange_String(name, fn); 1462 setRange_String(name, fn);
1463 } 1463 }
1464 } 1464 }
1465 if (startsWith_String(name, "~")) {
1466 /* This would be interpreted as a reference to a home directory. */
1467 remove_Block(&name->chars, 0, 1);
1468 }
1465 iString *savePath = concat_Path(downloadDir_App(), name); 1469 iString *savePath = concat_Path(downloadDir_App(), name);
1466 if (lastIndexOfCStr_String(savePath, ".") == iInvalidPos) { 1470 if (lastIndexOfCStr_String(savePath, ".") == iInvalidPos) {
1467 /* No extension specified in URL. */ 1471 /* No extension specified in URL. */