summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick 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)
commit2e55ba1179040cfafa04ebd482876fb51a83a3bd (patch)
tree650288487dc875c5a057cb7ec2f24730eba81338
parentc8bb2a877077e257f0d279eb0f864bf2008c09f6 (diff)
extract-copyright-comments: Fix detection of "**/"
For example, in networking/nslookup.c: /****** A version from LEDE / OpenWRT ******/
-rwxr-xr-xextract-copyright-comments10
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