mirror of
https://git.sr.ht/~cismonx/bookmarkfs
synced 2025-06-07 19:58:50 +00:00
fsck: limit history list length
Add a hard limit to prevent the history command list from growing unnecessarily large, especially when interactive fsck is automated with scripting.
This commit is contained in:
parent
0fd2cbbc9d
commit
b33f2ced0b
1 changed files with 5 additions and 0 deletions
|
@ -43,6 +43,10 @@
|
|||
#include "lib.h"
|
||||
#include "xstd.h"
|
||||
|
||||
#ifndef BOOKMARKFS_FSCK_RL_HISTORY_MAX
|
||||
# define BOOKMARKFS_FSCK_RL_HISTORY_MAX 256
|
||||
#endif
|
||||
|
||||
struct fsck_ctx {
|
||||
struct bookmarkfs_fsck_ops const *ops;
|
||||
struct bookmarkfs_fsck_handler const *handler;
|
||||
|
@ -107,6 +111,7 @@ init_readline (
|
|||
|
||||
rl_initialize();
|
||||
using_history();
|
||||
stifle_history(BOOKMARKFS_FSCK_RL_HISTORY_MAX);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue