mirror of
https://github.com/jarun/nnn.git
synced 2025-02-26 03:01:32 +00:00
List mode: limit exceeded error
This commit is contained in:
parent
b8ede9895f
commit
9fea0220c4
1 changed files with 12 additions and 4 deletions
16
src/nnn.c
16
src/nnn.c
|
@ -517,8 +517,9 @@ static char * const utils[] = {
|
||||||
#define MSG_RM_TMP 40
|
#define MSG_RM_TMP 40
|
||||||
#define MSG_NOCHNAGE 41
|
#define MSG_NOCHNAGE 41
|
||||||
#define MSG_CANCEL 42
|
#define MSG_CANCEL 42
|
||||||
|
#define MSG_LIMIT 43
|
||||||
#ifndef DIR_LIMITED_SELECTION
|
#ifndef DIR_LIMITED_SELECTION
|
||||||
#define MSG_DIR_CHANGED 43 /* Must be the last entry */
|
#define MSG_DIR_CHANGED 44 /* Must be the last entry */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const char * const messages[] = {
|
static const char * const messages[] = {
|
||||||
|
@ -565,6 +566,7 @@ static const char * const messages[] = {
|
||||||
"remove tmp file?",
|
"remove tmp file?",
|
||||||
"unchanged",
|
"unchanged",
|
||||||
"cancelled",
|
"cancelled",
|
||||||
|
"limit exceeded\n",
|
||||||
#ifndef DIR_LIMITED_SELECTION
|
#ifndef DIR_LIMITED_SELECTION
|
||||||
"dir changed, range sel off", /* Must be the last entry */
|
"dir changed, range sel off", /* Must be the last entry */
|
||||||
#endif
|
#endif
|
||||||
|
@ -6435,15 +6437,19 @@ static char *load_input()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entries == LIST_FILES_MAX)
|
if (entries == LIST_FILES_MAX) {
|
||||||
|
fprintf(stderr, messages[MSG_LIMIT], NULL);
|
||||||
goto malloc_1;
|
goto malloc_1;
|
||||||
|
}
|
||||||
|
|
||||||
offsets[entries++] = off;
|
offsets[entries++] = off;
|
||||||
off = next - input;
|
off = next - input;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chunk_count == 512)
|
if (chunk_count == 512) {
|
||||||
|
fprintf(stderr, messages[MSG_LIMIT], NULL);
|
||||||
goto malloc_1;
|
goto malloc_1;
|
||||||
|
}
|
||||||
|
|
||||||
/* We don't need to allocate another chunk */
|
/* We don't need to allocate another chunk */
|
||||||
if (chunk_count == (total_read - input_read) / chunk)
|
if (chunk_count == (total_read - input_read) / chunk)
|
||||||
|
@ -6459,8 +6465,10 @@ static char *load_input()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (off != total_read) {
|
if (off != total_read) {
|
||||||
if (entries == LIST_FILES_MAX)
|
if (entries == LIST_FILES_MAX) {
|
||||||
|
fprintf(stderr, messages[MSG_LIMIT], NULL);
|
||||||
goto malloc_1;
|
goto malloc_1;
|
||||||
|
}
|
||||||
|
|
||||||
offsets[entries++] = off;
|
offsets[entries++] = off;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue