mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-02 00:13:40 +02:00
fix issue with read builtin delimiter in invaild mutibyte char; fix crash if caller passes negative count argument to one of the history file writing functions
This commit is contained in:
@@ -745,6 +745,9 @@ history_do_write (const char *filename, int nelements, int overwrite)
|
||||
|
||||
history_lines_written_to_file = 0;
|
||||
|
||||
if (nelements < 0)
|
||||
return (0);
|
||||
|
||||
mode = overwrite ? O_RDWR|O_CREAT|O_TRUNC|O_BINARY : O_RDWR|O_APPEND|O_BINARY;
|
||||
#else
|
||||
mode = overwrite ? O_WRONLY|O_CREAT|O_TRUNC|O_BINARY : O_WRONLY|O_APPEND|O_BINARY;
|
||||
|
||||
Reference in New Issue
Block a user