]> git.ipfire.org Git - thirdparty/asterisk.git/commit
app_read: Fix custom terminator functionality regression
authorNaveen Albert <asterisk@phreaknet.org>
Mon, 25 Oct 2021 17:51:50 +0000 (17:51 +0000)
committerN A <mail@interlinked.x10host.com>
Tue, 16 Nov 2021 12:15:54 +0000 (07:15 -0500)
commit3c4b7cef641bb64a3b9b506f3fbe6a7e299fb5ee
treedcf09a94ef0b7bfce1315b90a83a5798bdb021dc
parent59715a073b221d95cbba1ba413cdf016bb2506e1
app_read: Fix custom terminator functionality regression

Currently, when the t option is specified with no arguments,
the # character is still treated as a terminator, even though
no character should be treated as a terminator.

This is because a previous regression fix was modified to
remove the use of NULL as a default altogether. However,
NULL and an empty string actually refer to different
arrangements and should be treated differently. NULL is the
default terminator (#), while an empty string removes the
terminator altogether. This is the behavior being used by
the rest of the core.

Additionally, since S_OR catches empty strings as well as
NULL (not intended), this is changed to a ternary operator
instead, which fixes the behavior.

ASTERISK-29705 #close

Change-Id: I9b6b72196dd04f5b1e0ab5aa1b0adf627725e086
apps/app_read.c
main/app.c