[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]

From: Assaf Gordon
Date: Sat, 1 Aug 2015 23:42:04 -0600


This tiny patch fixes a wrong regex in the gawk script 'build-aux/pmccabe2html'.
The commands replace '&' with '&amp;', '>' with '&gt;' and '<' with '&lt;',
but I think the actual replacement doesn't work properly.

A contrived example:

    $ echo '=>=' | gawk '{gsub(">","\&gt;",$0);print}'
    gawk: cmd. line:1: warning: escape sequence `\&' treated as plain `&'

The '\&' is treated as '&', and thus has special meaning for gsub (the matched 
The output therefor contains the matched '>' instead of an actual '&'.

With an extra backslash:

    $ echo '=>=' | gawk '{gsub(">","\\&gt;",$0);print}'

Another example: the recently updated cyclomatic report for gnu libidn at:
contains similarly incorrect HTML tags.
can be seen if one clicks on the down-arrow next to "_g_utf8_normalize_wc"
with lines such as:
 while ((max_len gt;= SBase && wc gt;= SBase && wc gt; 0)

 - assaf

Attachment: pmccabe.patch
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]