mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
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
This commit is contained in:
committed by
Kevin Harwell
parent
126de2839b
commit
2320a96349
@@ -250,7 +250,7 @@ static int read_exec(struct ast_channel *chan, const char *data)
|
||||
break;
|
||||
}
|
||||
tmp[x++] = res;
|
||||
if (strchr(terminator, tmp[x-1])) {
|
||||
if (terminator && strchr(terminator, tmp[x-1])) {
|
||||
tmp[x-1] = '\0';
|
||||
status = "OK";
|
||||
break;
|
||||
|
Reference in New Issue
Block a user