Menu

#131 rc.d script incorrectly recognized as 'D' with negative comment count

v1.63
closed
nobody
None
1
2015-06-27
2015-03-22
mulander
No

The attached 'garter_init.d' rc.d script is:
- incorrectly detected as language 'D'
- has a negative comment count (-1)

The issue was tested on the following versions of cloc:
- v1.60
- v1.62

On OpenBSD i386 current snapshots from march 19th using:

$ perl --version

This is perl 5, version 20, subversion 1 (v5.20.1) built for i386-openbsd

Copyright 1987-2014, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

$ cloc garter_init.d                                                                                                                       
       1 text file.
       1 unique file.                              
       0 files ignored.

http://cloc.sourceforge.net v 1.60  T=0.14 s (7.2 files/s, 460.8 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
D                                1             11             -1             54
-------------------------------------------------------------------------------
1 Attachments

Discussion

  • Al Danial

    Al Danial - 2015-03-22
    • status: open --> pending
     
  • Al Danial

    Al Danial - 2015-03-22

    Thanks for the bug report. While implementing the fix I learned .d could also refer to dtrace scripts so I added support for that too. Fix went in with svn commit 441; svn head is at
    https://sourceforge.net/p/cloc/code/HEAD/tree/trunk/cloc
    would be grateful if you'd test it out a bit.

     
  • mulander

    mulander - 2015-03-23

    Tested on revision 444:

    mulander@inferno:~/lab/cloc-code$ ./cloc --version
    1.63
    
    mulander@inferno:~/lab/cloc-code$ ./cloc garter_init.d 
           1 text file.
           1 unique file.                              
           0 files ignored.
    
    http://cloc.sourceforge.net v 1.63  T=0.01 s (144.3 files/s, 9232.5 lines/s)
    -------------------------------------------------------------------------------
    Language                     files          blank        comment           code
    -------------------------------------------------------------------------------
    Bourne Shell                     1             11              9             44
    -------------------------------------------------------------------------------
    

    Looks OK to me. No apparent issues while running on local checkouts of my code.

     
  • Al Danial

    Al Danial - 2015-06-27

    v1.64 released

     
  • Al Danial

    Al Danial - 2015-06-27
    • status: pending --> closed
     

Anonymous
Anonymous

Add attachments
Cancel