diff options
-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 |