mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 20:01:27 +00:00
Minor maintenance
This commit is contained in:
parent
6dfccce55d
commit
55abc13cd2
14
nnn.c
14
nnn.c
|
@ -1034,7 +1034,6 @@ xreadline(char *fname)
|
||||||
} else
|
} else
|
||||||
len = (size_t)-1;
|
len = (size_t)-1;
|
||||||
|
|
||||||
/* For future: handle NULL, say for a new name */
|
|
||||||
if (len == (size_t)-1) {
|
if (len == (size_t)-1) {
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
len = pos = 0;
|
len = pos = 0;
|
||||||
|
@ -1069,7 +1068,6 @@ xreadline(char *fname)
|
||||||
++len, ++pos;
|
++len, ++pos;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
switch (*ch) {
|
switch (*ch) {
|
||||||
case KEY_LEFT:
|
case KEY_LEFT:
|
||||||
|
@ -1409,8 +1407,7 @@ get_lsperms(mode_t mode, char *desc)
|
||||||
* If pager is valid, returns NULL
|
* If pager is valid, returns NULL
|
||||||
*/
|
*/
|
||||||
static char *
|
static char *
|
||||||
get_output(char *buf, size_t bytes, char *file, char *arg1, char *arg2,
|
get_output(char *buf, size_t bytes, char *file, char *arg1, char *arg2, int pager)
|
||||||
int pager)
|
|
||||||
{
|
{
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
int pipefd[2];
|
int pipefd[2];
|
||||||
|
@ -1733,8 +1730,7 @@ show_help(char *path)
|
||||||
dprintf(fd, "BOOKMARKS\n");
|
dprintf(fd, "BOOKMARKS\n");
|
||||||
for (; i < BM_MAX; ++i)
|
for (; i < BM_MAX; ++i)
|
||||||
if (bookmark[i].key)
|
if (bookmark[i].key)
|
||||||
dprintf(fd, " %s: %s\n",
|
dprintf(fd, " %s: %s\n", bookmark[i].key, bookmark[i].loc);
|
||||||
bookmark[i].key, bookmark[i].loc);
|
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
dprintf(fd, "\n");
|
dprintf(fd, "\n");
|
||||||
|
@ -1817,8 +1813,7 @@ dentfill(char *path, struct entry **dents,
|
||||||
if ((namep[0] == '.' && (namep[1] == '\0' || (namep[1] == '.' && namep[2] == '\0'))))
|
if ((namep[0] == '.' && (namep[1] == '\0' || (namep[1] == '.' && namep[2] == '\0'))))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (fstatat(fd, namep, &sb, AT_SYMLINK_NOFOLLOW)
|
if (fstatat(fd, namep, &sb, AT_SYMLINK_NOFOLLOW) == -1)
|
||||||
== -1)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (S_ISDIR(sb.st_mode)) {
|
if (S_ISDIR(sb.st_mode)) {
|
||||||
|
@ -2535,8 +2530,7 @@ nochange:
|
||||||
goto nochange;
|
goto nochange;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
mkpath(path, bookmark[r].loc,
|
mkpath(path, bookmark[r].loc, newpath, PATH_MAX);
|
||||||
newpath, PATH_MAX);
|
|
||||||
|
|
||||||
if (!xdiraccess(newpath))
|
if (!xdiraccess(newpath))
|
||||||
goto nochange;
|
goto nochange;
|
||||||
|
|
Loading…
Reference in a new issue