@miconda commented on this pull request.
> + del_offset = body->display.s - msg->buf;
+ del_len = body->display.len;
+ /* extend backward to include all spaces before display
*/
+ p = body->display.s - 1;
+ while(p >= msg->buf && isspace(*p)) {
+ del_offset--;
+ del_len++;
+ p--;
+ }
+ /* extend forward to include all spaces after display */
+ p = body->display.s + body->display.len;
+ } else {
+ /* no existing display - check spaces after colon
+ * hdr->name is "To"/"From" without ':', skip past it */
+ del_offset = (hdr->name.s + hdr->name.len + 1) -
msg->buf;
+ p = hdr->name.s + hdr->name.len + 1;
Probably it is indeed better to focus on the scope of the function to remove
the display name, and if it is no new value for display name, I think the right
logic is to remove from the start of the existing display name till the start
of the uri field, not caring about what it is before the display name.
If one wants to `pretty-print` all header like `HName: hbody\r\n` can use
headers iterator to reformat.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4586#discussion_r2795619880
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4586/review/[email protected]>_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the
sender!