Skip to content

Commit 10fb64f

Browse files
authored
ext/readline: readline_read_history/readline_write_history returning a boolean value using RETURN_BOOL (php#21140)
1 parent d84ad6a commit 10fb64f

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

ext/readline/readline.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -393,13 +393,9 @@ PHP_FUNCTION(readline_read_history)
393393
RETURN_FALSE;
394394
}
395395

396-
/* XXX from & to NYI */
397-
if (read_history(arg)) {
398-
/* If filename is NULL, then read from `~/.history' */
399-
RETURN_FALSE;
400-
} else {
401-
RETURN_TRUE;
402-
}
396+
/* XXX from & to NYI
397+
If filename is NULL, then read from `~/.history' */
398+
RETURN_BOOL(!read_history(arg));
403399
}
404400

405401
/* }}} */
@@ -417,11 +413,7 @@ PHP_FUNCTION(readline_write_history)
417413
RETURN_FALSE;
418414
}
419415

420-
if (write_history(arg)) {
421-
RETURN_FALSE;
422-
} else {
423-
RETURN_TRUE;
424-
}
416+
RETURN_BOOL(!write_history(arg));
425417
}
426418

427419
/* }}} */

0 commit comments

Comments
 (0)