diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2020-12-01 19:08:10 (EST) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2020-12-01 19:08:10 (EST) |
commit | 2e55ba1179040cfafa04ebd482876fb51a83a3bd (patch) | |
tree | 650288487dc875c5a057cb7ec2f24730eba81338 | |
parent | c8bb2a877077e257f0d279eb0f864bf2008c09f6 (diff) |
extract-copyright-comments: Fix detection of "**/"
For example, in networking/nslookup.c:
/****** A version from LEDE / OpenWRT ******/
-rwxr-xr-x | extract-copyright-comments | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/extract-copyright-comments b/extract-copyright-comments index 6b603b6..87d0d3b 100755 --- a/extract-copyright-comments +++ b/extract-copyright-comments @@ -67,23 +67,27 @@ extract_cxx_comment() extract_c_comment() { local comment='/*' + local asterisk=false while :; do getc case "${c}" in '*') + asterisk=true comment="${comment}${c}" - getc + ;; + '/') comment="${comment}${c}" - case "${c}" in '/') + if ${asterisk}; then break - esac + fi ;; '') printf '\tError: Unterminated C comment\n' 1>&2 return 1 ;; *) + asterisk=false comment="${comment}${c}" ;; esac |