<p>Richard Mudgett <strong>posted comments</strong> on this change.</p><p><a href="https://gerrit.asterisk.org/7871">View Change</a></p><p>Patch set 5:</p><p>(1 comment)</p><ul style="list-style: none; padding-left: 20px;"><li><p><a href="https://gerrit.asterisk.org/#/c/7871/5/main/strings.c">File main/strings.c:</a></p><ul style="list-style: none; padding-left: 20px;"><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/7871/5/main/strings.c@411">Patch Set #5, Line 411:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">        while ((cur = strsep(&buf, delim))) {<br>             if (excludes_cmp && AST_VECTOR_GET_CMP(dest, cur, !excludes_cmp)) {<br></pre></blockquote></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">The current purpose of this function is to parse the module dependencies (s</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">The strip and empty string skip functionality would be:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">while ((cur = strsep(&buf, delim))) {<br>  cur = ast_strip(cur);<br>  if (!ast_strlen_zero(cur)) {<br>     continue;<br>  }<br>  ...<br>}</pre><p style="white-space: pre-wrap; word-wrap: break-word;">Yes a flags argument would do to express the optional functionality.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I was thinking of two options really:</p><p style="white-space: pre-wrap; word-wrap: break-word;">1) Strip blanks from the delimited strings.  Stripping blanks from the strings could be made non-optional as there are few cases where it would be desirable to not strip leading and trailing blanks.</p><p style="white-space: pre-wrap; word-wrap: break-word;">2) Ignore empty delimited strings.  Skipping empty strings is the more optional functionality that would be desired.  Sometimes you may want things by position even if they are empty.</p><p style="white-space: pre-wrap; word-wrap: break-word;">alice, , bob, charlie</p><p style="white-space: pre-wrap; word-wrap: break-word;">Actually implementing these options with a flags parameter is fairly cheap.  Simply test if the flag bit is set and do or not do the option.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I think it should be added.  The pjsip_configuration.c:ident_handler() nearly implements this very function.  In the future it may actually use it if we ever allow dynamically added identifier names for the endpoint identify_by configuration option.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/7871">change 7871</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/7871"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I1bf02a1efeb2baeea11c59c557d39dd1197494d7 </div>
<div style="display:none"> Gerrit-Change-Number: 7871 </div>
<div style="display:none"> Gerrit-PatchSet: 5 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Sun, 14 Jan 2018 23:47:09 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>