mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Use target vars to create dirs
This commit is contained in:
parent
78d0ea50f4
commit
146f24e5de
16
src/nnn.c
16
src/nnn.c
|
@ -6508,10 +6508,8 @@ static bool setup_config(void)
|
||||||
DPRINTF_S(cfgdir);
|
DPRINTF_S(cfgdir);
|
||||||
|
|
||||||
/* Create ~/.config/nnn/plugins */
|
/* Create ~/.config/nnn/plugins */
|
||||||
xstrlcpy(cfgdir + r + 4 - 1, "/plugins", 9); /* subtract length of "/nnn" (4) */
|
xstrlcpy(plugindir, cfgdir, PATH_MAX);
|
||||||
DPRINTF_S(cfgdir);
|
xstrlcpy(plugindir + r + 4 - 1, "/plugins", 9); /* subtract length of "/nnn" (4) */
|
||||||
|
|
||||||
xstrlcpy(plugindir, cfgdir, len);
|
|
||||||
DPRINTF_S(plugindir);
|
DPRINTF_S(plugindir);
|
||||||
|
|
||||||
if (access(plugindir, F_OK) && !xmktree(plugindir, TRUE)) {
|
if (access(plugindir, F_OK) && !xmktree(plugindir, TRUE)) {
|
||||||
|
@ -6520,10 +6518,8 @@ static bool setup_config(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create ~/.config/nnn/sessions */
|
/* Create ~/.config/nnn/sessions */
|
||||||
xstrlcpy(cfgdir + r + 4 - 1, "/sessions", 10); /* subtract length of "/nnn" (4) */
|
xstrlcpy(sessiondir, cfgdir, PATH_MAX);
|
||||||
DPRINTF_S(cfgdir);
|
xstrlcpy(sessiondir + r + 4 - 1, "/sessions", 10); /* subtract length of "/nnn" (4) */
|
||||||
|
|
||||||
xstrlcpy(sessiondir, cfgdir, len);
|
|
||||||
DPRINTF_S(sessiondir);
|
DPRINTF_S(sessiondir);
|
||||||
|
|
||||||
if (access(sessiondir, F_OK) && !xmktree(sessiondir, TRUE)) {
|
if (access(sessiondir, F_OK) && !xmktree(sessiondir, TRUE)) {
|
||||||
|
@ -6531,10 +6527,6 @@ static bool setup_config(void)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reset to config path */
|
|
||||||
cfgdir[r + 3] = '\0';
|
|
||||||
DPRINTF_S(cfgdir);
|
|
||||||
|
|
||||||
/* Set selection file path */
|
/* Set selection file path */
|
||||||
if (!cfg.picker) {
|
if (!cfg.picker) {
|
||||||
/* Length of "/.config/nnn/.selection" */
|
/* Length of "/.config/nnn/.selection" */
|
||||||
|
|
Loading…
Reference in a new issue