Description of problem: source-highlight: error during regex processing Specific block of comment code from C source file causes error. Version-Release number of selected component (if applicable): source-highlight-2.3-1.fc5 How reproducible: Every time. Steps to Reproduce: 1. Run attached b.sh script. 2. 3. Actual results: Error. Expected results: Process the source file. Additional info: Problematic code from distribution supplied source file. Altering the source files to avoid problem is not possible. Output from running attached b.sh script: BEGIN OUTPUT GNU source-highlight 2.3 Copyright (C) 1999-2005 Lorenzo Bettini <bettini> This program comes with ABSOLUTELY NO WARRANTY. This is free software; you may redistribute copies of the program under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING. source-highlight-2.3-1.fc5 source-highlight: error during regex processing FAILED c_comment.lang:15: (/\*) formatting: "/*" as comment entering: (\*/)|(/\*)|((?:(?:(?:<?)(?:[[:word:]]+)(?:[\.\-_][[:word:]]+)*@(?:[[:word:]]+)(?:[\.\-_][[:word:]]+)*(?:>?))))|((?:(?:[[:word:]]+://(?:[[:word:]]+[\./\-_]?)+)))|((?:(?:TODO|FIXME)(?:[:]?))) source-highlight: error during regex processing END OUTPUT BEGIN b.sh #!/bin/sh cat > main.c <<EOF /* _________________________________________________________________ ** ** Utility Functions ** _________________________________________________________________ */ int main() { return 0; } EOF runit() { source-highlight --out-format html main.c --gen-references=inline $1 } source-highlight --version rpm -qa | grep source-highlight runit || { echo FAILED; runit --debug-lang; } END b.sh
Created attachment 131072 [details] Generate error script
Created attachment 131301 [details] fixed url lang file
Created attachment 131302 [details] file to test the bug fix
Hi I'm the author of GNU source-highlight Indeed it's a problem with url.lang regular expressions. I think I fixed it now; in the previous attachments you find the fixed version and also a more involved test example (sorry but I still have to practice with bugzilla, and I should've put altogether instead of three different messages :-) I look forward to hearing feedback
Lorenzo, thanks for your fix. I will integrate it into a new release.
it does not build for me with the new url.lang: Processed ./Hello.java ../src/source-highlight --data-dir ../src/ -s java -f html --style-file ../src/default.style --line-number --doc -i ./Hello.java -o Hello_lines.html ../src/source-highlight --data-dir ../src/ -s java -f xhtml --doc -i ./Hello.java -o Hello_xhtml.html --css ./xhtml.css ../src/source-highlight --data-dir ../src/ -s java -f xhtml --doc -i ./Hello.java -o Hello_xhtml2.html --style-file ../src/default.style ../src/source-highlight --data-dir ../src/ -s cpp -f html --style-file ../src/default.style --doc --output-dir=../doc ../src/startapp.cc ../src/source-highlight --data-dir ../src/ -s cpp -f html --style-file ../src/default.style --doc --output-dir=../doc --css="./mono.css" ../src/lib/cmdline.h ../src/source-highlight --data-dir ../src/ -s flex -f html --style-file ../src/default.style --doc --output-dir=../doc ./flex_scanner.ll Processed ./flex_scanner.ll ../src/source-highlight --data-dir ../src/ --style-file ../src/default.style -i ../src/langdef.lang -o langdef.lang.html source-highlight: error during regex processing make[3]: *** [startapp.cc.html] Error 1 make[3]: *** Waiting for unfinished jobs.... Processed ../src/lib/cmdline.h make[3]: Leaving directory `/home/adrian/devel/fedora/rpms/source-highlight/devel/source-highlight-2.3/doc' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/adrian/devel/fedora/rpms/source-highlight/devel/source-highlight-2.3' make[1]: *** [all] Error 2 make[1]: Leaving directory `/home/adrian/devel/fedora/rpms/source-highlight/devel/source-highlight-2.3'
Created attachment 131352 [details] (hopefully) fixed fixed version sorry, I was too fast in releasing the fix :-( this one, besides being more readable, should be the right one :-)
Created attachment 131353 [details] file to test the bug fix and here's the modified test file
I have released new versions which include the new url.lang file for FC-4, FC-5 and FC-6.
OK, so I assume that it didn't raise any other problems, did it? thanks Lorenzo