On Wed, 2008-12-31 at 12:24 -0500, Jameson Graef Rollins wrote: > I've found a small bug in checkbashisms' processing of the "((...))" > bashisms. For some reason, it doesn't find the bashism if "$#" is > used in the enclosed expression: > > servo:/tmp/cdtemp.JNHNWu 0$ cat ./foo > #!/bin/sh > (( $# < 2 )) > servo:/tmp/cdtemp.JNHNWu 0$ checkbashisms -p ./foo [...] > Not sure why this happening, and unfortunately I don't know enough > regexp to attempt to supply a patch.
The problem is that the "#" is being treated as the beginning of a comment and everything after it removed (at which point there no longer is a complete "(( ))" to flag). Modifying the comment removal to not treat "$#" as the start of a comment fixes this particular instance, but I'm not sure whether there are any other cases where it'll break. > Thanks so much for supplying such a useful tool. You're welcome. :-) Regards, Adam -- To unsubscribe, send mail to [email protected].
