mirror of
https://github.com/jarun/nnn.git
synced 2025-01-25 02:06:50 +00:00
Remove redundant change for HOME
This commit is contained in:
parent
b0132ba440
commit
cd4009dbf6
17
src/nnn.c
17
src/nnn.c
|
@ -366,14 +366,12 @@ static char mv[] = "mvg -gi";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Common strings */
|
/* Common strings */
|
||||||
#define STR_NOHOME_ID 0
|
#define STR_INPUT_ID 0
|
||||||
#define STR_INPUT_ID 1
|
#define STR_INVBM_KEY 1
|
||||||
#define STR_INVBM_KEY 2
|
#define STR_DATE_ID 2
|
||||||
#define STR_DATE_ID 3
|
#define STR_TMPFILE 3
|
||||||
#define STR_TMPFILE 4
|
|
||||||
|
|
||||||
static const char * const messages[] = {
|
static const char * const messages[] = {
|
||||||
"HOME not set",
|
|
||||||
"no traversal",
|
"no traversal",
|
||||||
"invalid key",
|
"invalid key",
|
||||||
"%F %T %z",
|
"%F %T %z",
|
||||||
|
@ -1884,11 +1882,6 @@ static char *get_bm_loc(char *buf, int key)
|
||||||
for (; bookmark[r].key && r < BM_MAX; ++r) {
|
for (; bookmark[r].key && r < BM_MAX; ++r) {
|
||||||
if (bookmark[r].key == key) {
|
if (bookmark[r].key == key) {
|
||||||
if (bookmark[r].loc[0] == '~') {
|
if (bookmark[r].loc[0] == '~') {
|
||||||
if (!home) {
|
|
||||||
DPRINTF_S(messages[STR_NOHOME_ID]);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
ssize_t count = xstrlcpy(buf, home, PATH_MAX);
|
ssize_t count = xstrlcpy(buf, home, PATH_MAX);
|
||||||
|
|
||||||
xstrlcpy(buf + count - 1, bookmark[r].loc + 1, PATH_MAX - count - 1);
|
xstrlcpy(buf + count - 1, bookmark[r].loc + 1, PATH_MAX - count - 1);
|
||||||
|
@ -3195,7 +3188,7 @@ nochange:
|
||||||
case SEL_VISIT:
|
case SEL_VISIT:
|
||||||
switch (sel) {
|
switch (sel) {
|
||||||
case SEL_CDHOME:
|
case SEL_CDHOME:
|
||||||
home ? (dir = home) : (dir = path);
|
dir = home;
|
||||||
break;
|
break;
|
||||||
case SEL_CDBEGIN:
|
case SEL_CDBEGIN:
|
||||||
dir = ipath;
|
dir = ipath;
|
||||||
|
|
Loading…
Reference in a new issue