mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
Fix regression in #864
This commit is contained in:
parent
c7140e6758
commit
8886f1cd56
18
src/nnn.c
18
src/nnn.c
|
@ -1330,16 +1330,17 @@ static size_t seltofile(int fd, uint_t *pcount)
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* List selection from selection file (another instance) */
|
static bool isselfileempty(void)
|
||||||
static bool listselfile(void)
|
|
||||||
{
|
{
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
|
|
||||||
if (stat(selpath, &sb) == -1)
|
return (stat(selpath, &sb) == -1) || (!sb.st_size);
|
||||||
return FALSE;
|
}
|
||||||
|
|
||||||
/* Nothing selected if file size is 0 */
|
/* List selection from selection file (another instance) */
|
||||||
if (!sb.st_size)
|
static bool listselfile(void)
|
||||||
|
{
|
||||||
|
if (isselfileempty())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
snprintf(g_buf, CMD_LEN_MAX, "tr \'\\0\' \'\\n\' < %s", selpath);
|
snprintf(g_buf, CMD_LEN_MAX, "tr \'\\0\' \'\\n\' < %s", selpath);
|
||||||
|
@ -2087,6 +2088,11 @@ static bool cpmvrm_selection(enum action sel, char *path)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
if (isselfileempty()) {
|
||||||
|
printmsg(messages[MSG_0_SELECTED]);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (!selsafe())
|
if (!selsafe())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue