bagder: curl-www/docs faqparse.pl,1.6,1.7

[email protected]
Newsgroups gmane.comp.web.curl.www.cvs
Message-ID <[email protected]>
Update of /cvsroot/curl/curl-www/docs
In directory labb:/tmp/cvs-serv14212

Modified Files:
	faqparse.pl 
Log Message:
fix the script for numbers > 9 and > 10


Index: faqparse.pl
===================================================================
RCS file: /cvsroot/curl/curl-www/docs/faqparse.pl,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- faqparse.pl	20 Sep 2007 14:39:42 -0000	1.6
+++ faqparse.pl	9 Dec 2007 12:18:52 -0000	1.7
@@ -26,7 +26,7 @@
             my $o=0;
             for(@toc) {
                 $s = $_;
-                $s =~ s/^([0-9]).*/$1/g;
+                $s =~ s/^([0-9]+).*/$1/g;
                 if($s != $o) {
                     my $ti = $section[$s];
                     chomp $ti;
@@ -43,7 +43,7 @@
             
             next;
         }
-        if($_ =~ /([0-9.]+\.[0-9]+) (.*)/) {
+        if($_ =~ /([0-9]+\.[0-9]+) (.*)/) {
             my ($num, $phrase)=($1, $2);
 #            print "$num $phrase\n";
             $faq{$num} = $phrase;
@@ -59,7 +59,7 @@
             $link{$num} = $l;
             push @toc, $num;
         }
-        elsif($_ =~ /([0-9])\. (.*)/) {
+        elsif($_ =~ /([0-9]+)\. (.*)/) {
 #            print "SECTION: $1 \"$2\"\n";
             $section[$1]=$2;
             push @secs, $2;
@@ -68,7 +68,7 @@
     elsif($state == 3) {
         my $l = $_;
 
-        if($secs[$sec] && ($_ =~ /^\s*[0-9]\. $secs[$sec]/i)) {
+        if($secs[$sec] && ($_ =~ /^\s*([0-9]+)\. $secs[$sec]/i)) {
             # a new section
             my $ti = $l;
             chomp $ti;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.