From 10fb64fed7016c6beb0aad1e39afc5e893277fa1 Mon Sep 17 00:00:00 2001 From: Arshid Date: Thu, 5 Feb 2026 23:53:18 +0530 Subject: [PATCH] ext/readline: readline_read_history/readline_write_history returning a boolean value using RETURN_BOOL (#21140) --- ext/readline/readline.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/ext/readline/readline.c b/ext/readline/readline.c index 838c74da86c..61129194db2 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -393,13 +393,9 @@ PHP_FUNCTION(readline_read_history) RETURN_FALSE; } - /* XXX from & to NYI */ - if (read_history(arg)) { - /* If filename is NULL, then read from `~/.history' */ - RETURN_FALSE; - } else { - RETURN_TRUE; - } + /* XXX from & to NYI + If filename is NULL, then read from `~/.history' */ + RETURN_BOOL(!read_history(arg)); } /* }}} */ @@ -417,11 +413,7 @@ PHP_FUNCTION(readline_write_history) RETURN_FALSE; } - if (write_history(arg)) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } + RETURN_BOOL(!write_history(arg)); } /* }}} */