[Asterisk-code-review] pbx_variables: Fix parsing multiple = in Set command (asterisk[16])

Sean Bright asteriskteam at digium.com
Mon Jan 25 11:12:08 CST 2021


Sean Bright has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/15331 )

Change subject: pbx_variables: Fix parsing multiple = in Set command
......................................................................


Patch Set 3:

(3 comments)

https://gerrit.asterisk.org/c/asterisk/+/15331/3/main/utils.c 
File main/utils.c:

https://gerrit.asterisk.org/c/asterisk/+/15331/3/main/utils.c@2379 
PS3, Line 2379: int ast_parse_name_value(const char *input, char **name, char **value)
Unless there are additional consumers of this function I don't see a compelling reason to make it part of the public API. A couple suggestions:

* Move it back into pbx_variables.c
* Make the signature and behavior identical to strsep() except that it finds the "correct" equals sign instead of just the first one


https://gerrit.asterisk.org/c/asterisk/+/15331/3/main/utils.c@2388 
PS3, Line 2388: 	if (ast_strlen_zero(input)) {
              : 	  ast_log(LOG_ERROR, "Input must be not NULL");
              : 	  ret = -1;
              : 	}
This error message appears to me to be directed at a programmer and not a user. If this function should not accept NULLs, make this an ast_assert(). If passing NULL is OK, then remove the error message.


https://gerrit.asterisk.org/c/asterisk/+/15331/3/main/utils.c@2411 
PS3, Line 2411:             quote = quote ? 0 : 1;
quote = !quote;



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15331
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I7cd3bc6118033530ad00ae4b6bdad97b6b349b6f
Gerrit-Change-Number: 15331
Gerrit-PatchSet: 3
Gerrit-Owner: Leandro Dardini <ldardini at gmail.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-Comment-Date: Mon, 25 Jan 2021 17:12:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210125/e95404e0/attachment.html>


More information about the asterisk-code-review mailing list