fix section heading heuristic
authornsz <nsz@port70.net>
Mon, 4 Jul 2011 11:18:42 +0000 (13:18 +0200)
committernsz <nsz@port70.net>
Mon, 4 Jul 2011 11:18:42 +0000 (13:18 +0200)
n1256.html
n1548.html
tohtml.sh

index 440a39e..791746b 100644 (file)
@@ -1629,7 +1629,7 @@ Forward references:        conditional inclusion (<a href="#6.10.1">6.10.1</a>),
 
     21) There is no linkage between different identifiers.
     22) A function declaration can contain the storage-class specifier static only if it is at file scope; see
-<a name="6.7.1" href="#6.7.1"><b>        6.7.1.</b></a>
+        <a href="#6.7.1">6.7.1</a>.
 
 [<a name="p30" href="#p30">page 30</a>] (<a href="#Contents">Contents</a>)
 
@@ -3104,7 +3104,7 @@ Forward references:        conditional inclusion (<a href="#6.10.1">6.10.1</a>),
     object (in which case it is an lvalue) or a function (in which case it is a function
     designator).79)
 3   A constant is a primary expression. Its type depends on its form and value, as detailed in
-<a name="6.4.4" href="#6.4.4"><b>    6.4.4.</b></a>
+    <a href="#6.4.4">6.4.4</a>.
 4   A string literal is a primary expression. It is an lvalue with type as detailed in <a href="#6.4.5">6.4.5</a>.
 5   A parenthesized expression is a primary expression. Its type and value are identical to
     those of the unparenthesized expression. It is an lvalue, a function designator, or a void
@@ -10305,7 +10305,7 @@ char int_p_sep_by_space
 <a name="7.18.2" href="#7.18.2"><b>    7.18.2 Limits of specified-width integer types</b></a>
 1   The following object-like macros226) specify the minimum and maximum limits of the
     types declared in <a href="#7.18">&lt;stdint.h&gt;</a>. Each macro name corresponds to a similar type name in
-<a name="7.18.1" href="#7.18.1"><b>    7.18.1.</b></a>
+    <a href="#7.18.1">7.18.1</a>.
 2   Each instance of any defined macro shall be replaced by a constant expression suitable
     for use in #if preprocessing directives, and this expression shall have the same type as
     would an expression that is an object of the corresponding type converted according to
@@ -10408,7 +10408,7 @@ char int_p_sep_by_space
 1   The following function-like macros230) expand to integer constants suitable for
     initializing objects that have integer types corresponding to types defined in
     <a href="#7.18">&lt;stdint.h&gt;</a>. Each macro name corresponds to a similar type name in <a href="#7.18.1.2">7.18.1.2</a> or
-<a name="7.18.1.5" href="#7.18.1.5"><b>    7.18.1.5.</b></a>
+    <a href="#7.18.1.5">7.18.1.5</a>.
 2   The argument in any instance of these macros shall be an unsuffixed integer constant (as
     defined in <a href="#6.4.4.1">6.4.4.1</a>) with a value that does not exceed the limits for the corresponding type.
 3   Each invocation of one of these macros shall expand to an integer constant expression
index 50e2b6e..bacc161 100644 (file)
@@ -2146,7 +2146,7 @@ Forward references:        conditional inclusion (<a href="#6.10.1">6.10.1</a>),
     (<a href="#6.7.2.3">6.7.2.3</a>), the goto statement (<a href="#6.8.6.1">6.8.6.1</a>).
 
     30) A function declaration can contain the storage-class specifier static only if it is at file scope; see
-<a name="6.7.1" href="#6.7.1"><b>        6.7.1.</b></a>
+        <a href="#6.7.1">6.7.1</a>.
     31) As specified in <a href="#6.2.1">6.2.1</a>, the later declaration might hide the prior declaration.
     32) There is only one name space for tags even though three are possible.
 
@@ -2155,7 +2155,7 @@ Forward references:        conditional inclusion (<a href="#6.10.1">6.10.1</a>),
 <a name="6.2.4" href="#6.2.4"><b>    6.2.4 Storage durations of objects</b></a>
 1   An object has a storage duration that determines its lifetime. There are four storage
     durations: static, thread, automatic, and allocated. Allocated storage is described in
-<a name="7.22.3" href="#7.22.3"><b>    7.22.3.</b></a>
+    <a href="#7.22.3">7.22.3</a>.
 2   The lifetime of an object is the portion of program execution during which storage is
     guaranteed to be reserved for it. An object exists, has a constant address,33) and retains
     its last-stored value throughout its lifetime.34) If an object is referred to outside of its
@@ -3737,7 +3737,7 @@ Forward references:        conditional inclusion (<a href="#6.10.1">6.10.1</a>),
     object (in which case it is an lvalue) or a function (in which case it is a function
     designator).91)
 3   A constant is a primary expression. Its type depends on its form and value, as detailed in
-<a name="6.4.4" href="#6.4.4"><b>    6.4.4.</b></a>
+    <a href="#6.4.4">6.4.4</a>.
 4   A string literal is a primary expression. It is an lvalue with type as detailed in <a href="#6.4.5">6.4.5</a>.
 5   A parenthesized expression is a primary expression. Its type and value are identical to
     those of the unparenthesized expression. It is an lvalue, a function designator, or a void
@@ -11822,7 +11822,7 @@ Forward references: localization (<a href="#7.11">7.11</a>).
 <a name="7.20.2" href="#7.20.2"><b>    7.20.2 Limits of specified-width integer types</b></a>
 1   The following object-like macros specify the minimum and maximum limits of the types *
     declared in <a href="#7.20">&lt;stdint.h&gt;</a>. Each macro name corresponds to a similar type name in
-<a name="7.20.1" href="#7.20.1"><b>    7.20.1.</b></a>
+    <a href="#7.20.1">7.20.1</a>.
 2   Each instance of any defined macro shall be replaced by a constant expression suitable
     for use in #if preprocessing directives, and this expression shall have the same type as
     would an expression that is an object of the corresponding type converted according to
index cf86abc..f71aa34 100755 (executable)
--- a/tohtml.sh
+++ b/tohtml.sh
@@ -46,7 +46,8 @@ BEGIN {
        if (id ~ /Annex/)
                id = $2
        if (($0 ~ /^    [1-9]\./ || id ~ /^([A-Z]|[1-9A-Z]\.[1-9][0-9.]*|Index|Foreword|Introduction|Bibliography)$/) &&
-           (NF==1 || $2 ~ /^[A-Z]/)) {
+           (NF==1 || $2 ~ /^[A-Z]/) &&
+           ($0 !~ /^ *[0-9.]+[^0-9]$/)) {
                if (id ~ /\.$/)
                        id = substr(id,1,length(id)-1)
                print "<a name=\"" id "\" href=\"#" id "\"><b>" $0 "</b></a>"