Bug#700944: Patch for clean_comments() in licensecheck.pl

Laurent Rineau (CGAL/GeometryFactory) laurent.rineau at cgal.org
Tue Feb 19 15:38:46 UTC 2013


Package: devscripts
Version: 2.13.0
Severity: normal

That last version 2.13.0 of licensecheck.pl showed a bug, on the attached file 
"min_dihedral_angle.h". That file is part of CGAL-4.1, and should be detected 
as GPLv3+, instead of UNKNOWN. The bug is in the generic detection of 
comments, in clean_comments(). There is a regular expression, that detects 
potential comments. The pattern length is computed from the last match of the 
regular expression. In the case of the attached file "min_dihedral_angle.h", 
the last match is the last "/" in the following lines (line 50):

      return CGAL::sqrt(sq_distance(p0, p1))
        / area(make_triangle(p0, p1, p3))
        / area(make_triangle(p0, p1, p2));

That is obviously not a C++ comment.

The attached patch "0001-Fix-clean_comments.patch" computes the length of the 
pattern from the *first* match, instead of the last one. That fixes the bug.

-- 
Laurent Rineau, PhD
R&D Engineer at GeometryFactory           http://www.geometryfactory.com/
Release Manager of the CGAL Project       http://www.cgal.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: min_dihedral_angle.h
Type: text/x-chdr
Size: 1985 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/devscripts-devel/attachments/20130219/5703d437/attachment.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-clean_comments.patch
Type: text/x-patch
Size: 1278 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/devscripts-devel/attachments/20130219/5703d437/attachment.bin>


More information about the devscripts-devel mailing list