.TP
.BI ":s[ave] [" PATH "]"
Download current opened page into configured download directory. If \fIPATH\fP
-is given, download under this file name or path. \fIPATH\fP is expanded via
-shell and can therefor contain '~/', '${ENV}' and '~user' pattern.
+is given, download under this file name or path. \fIPATH\fP is expanded and
+can therefor contain '~/', '${ENV}' and '~user' pattern.
.TP
.B :q[uit]
Close the browser.
Cookie timeout in seconds.
.TP
.B download-path (string)
-Path to the default download directory. Note that the set path is expanded via
-shell, so you can use '~/path' or '$HOME/foo'.
+Path to the default download directory. If the directory is not set download
+will be written into current directory. Following pattern will be expanded if
+the download is started '~/', '~user', '$VAR' and '${VAR}'.
.TP
.B editor-command (string)
Command with placeholder '%s' called if form filed is opened with editor to
static SettingStatus download_path(const Setting *s, const SettingType type)
{
- char *path;
if (type == SETTING_GET) {
print_value(s, vb.config.download_dir);
} else {
- if (vb.config.download_dir) {
- g_free(vb.config.download_dir);
- vb.config.download_dir = NULL;
- }
-
- path = util_expand(s->arg.s);
- if (*path) {
- /* if path is not absolute set it in the home directory */
- if (*path != '/') {
- vb.config.download_dir = g_build_filename(util_get_home_dir(), path, NULL);
- g_free(path);
- } else {
- vb.config.download_dir = path;
- }
- /* create the path if it does not exist */
- util_create_dir_if_not_exists(vb.config.download_dir);
- } else {
- /* set the empty path */
- vb.config.download_dir = path;
- }
+ OVERWRITE_STRING(vb.config.download_dir, s->arg.s);
}
return SETTING_OK;