[Asterisk-code-review] astconfigparser: Really handle case where line is simply a c... (asterisk[13])

Kevin Harwell asteriskteam at digium.com
Wed Aug 3 12:01:26 CDT 2016


Kevin Harwell has posted comments on this change.

Change subject: astconfigparser: Really handle case where line is simply a comment.
......................................................................


Patch Set 1:

(1 comment)

https://gerrit.asterisk.org/#/c/3406/1/contrib/scripts/sip_to_pjsip/astconfigparser.py
File contrib/scripts/sip_to_pjsip/astconfigparser.py:

PS1, Line 201:     match = re.match(r'.*?([^\\];)', line)
             : 
             :     if match:
             :          # the end of where the real string is is where the comment starts
             :          line = line[0:(match.end()-1)]
             :     if line.startswith(";"):
             :          # if the line is actually a comment just ignore it all
             :          line = ""
I was wondering why this was needed since the regex should seemingly take care of this case as well, but it appears the regex does not match on a ';' at the start of the line.

Maybe move the startswith check to be in front of the regex and return if it does start with a ';'? Fixing the regex is an option too :-) or I guess as it is doesn't hurt. Thoughts?


-- 
To view, visit https://gerrit.asterisk.org/3406
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I3e4022481037ebcba9905587fe8c764b4ce21819
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list