mirror of https://github.com/djcb/mu.git
* mu-config: properly expand the dirs in mu find (--linksdir) and extract (--targetdir)
This commit is contained in:
parent
2a0858b349
commit
dcb64c02a6
|
@ -117,21 +117,26 @@ config_options_group_mu (void)
|
||||||
return og;
|
return og;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#define expand_dir(D) \
|
||||||
|
if ((D)) { \
|
||||||
|
char *exp; \
|
||||||
|
exp = mu_util_dir_expand((D)); \
|
||||||
|
if (exp) { \
|
||||||
|
g_free((D)); \
|
||||||
|
(D) = exp; \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_group_index_defaults (void)
|
set_group_index_defaults (void)
|
||||||
{
|
{
|
||||||
char *exp;
|
|
||||||
|
|
||||||
if (!MU_CONFIG.maildir)
|
if (!MU_CONFIG.maildir)
|
||||||
MU_CONFIG.maildir = mu_util_guess_maildir ();
|
MU_CONFIG.maildir = mu_util_guess_maildir ();
|
||||||
|
|
||||||
if (MU_CONFIG.maildir) {
|
expand_dir (MU_CONFIG.maildir);
|
||||||
exp = mu_util_dir_expand(MU_CONFIG.maildir);
|
|
||||||
if (exp) {
|
|
||||||
g_free(MU_CONFIG.maildir);
|
|
||||||
MU_CONFIG.maildir = exp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static GOptionGroup*
|
static GOptionGroup*
|
||||||
|
@ -183,6 +188,8 @@ set_group_find_defaults (void)
|
||||||
else
|
else
|
||||||
MU_CONFIG.format =
|
MU_CONFIG.format =
|
||||||
get_output_format (MU_CONFIG.formatstr);
|
get_output_format (MU_CONFIG.formatstr);
|
||||||
|
|
||||||
|
expand_dir (MU_CONFIG.linksdir);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GOptionGroup*
|
static GOptionGroup*
|
||||||
|
@ -338,6 +345,14 @@ config_options_group_view (void)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
set_group_extract_defaults (void)
|
||||||
|
{
|
||||||
|
expand_dir (MU_CONFIG.targetdir);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static GOptionGroup*
|
static GOptionGroup*
|
||||||
config_options_group_extract (void)
|
config_options_group_extract (void)
|
||||||
{
|
{
|
||||||
|
@ -620,6 +635,7 @@ mu_config_init (int *argcp, char ***argvp)
|
||||||
set_group_find_defaults();
|
set_group_find_defaults();
|
||||||
set_group_cfind_defaults();
|
set_group_cfind_defaults();
|
||||||
set_group_view_defaults();
|
set_group_view_defaults();
|
||||||
|
set_group_extract_defaults();
|
||||||
/* set_group_mkdir_defaults (config); */
|
/* set_group_mkdir_defaults (config); */
|
||||||
|
|
||||||
return &MU_CONFIG;
|
return &MU_CONFIG;
|
||||||
|
@ -659,8 +675,6 @@ mu_config_param_num (MuConfig *opts)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MuMsgOptions
|
MuMsgOptions
|
||||||
mu_config_get_msg_options (MuConfig *muopts)
|
mu_config_get_msg_options (MuConfig *muopts)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue