From: David Schleef Date: Wed, 19 Sep 2001 00:33:50 +0000 (+0000) Subject: Fix parse problem X-Git-Tag: r0_7_61~71 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9041458fefd11a65cc9c153e940d0f50ce7abbc9;p=comedi.git Fix parse problem --- diff --git a/scripts/doc_devlist b/scripts/doc_devlist index 6fd44590..cfe48023 100755 --- a/scripts/doc_devlist +++ b/scripts/doc_devlist @@ -16,24 +16,22 @@ while(){ } $driver = ""; -while($_=shift @lines){ - if( m/^[\w-]+: / ){ - if($l){ - #print "$l\n"; - if($l =~ m/^Driver: /){ - $_ = $l; - s/^Driver: //; - $driver = $_; - } +$mode = 0; +while($line=shift @lines){ + $_ = $line; + if( $mode == 0){ + if( m/^[\w-]+: / ){ + chomp; + $l=$_; + $mode = 1; } - chomp; - $l=$_; - }elsif( m/^ / ){ - s/^ +//; - chomp; - $l="$l $_"; - }else{ - if($l){ + }elsif($mode==1){ + if( m/^ / ){ + s/^ +//; + chomp; + $l="$l $_"; + $mode = 1; + }else{ #print "$l\n"; if($l =~ m/^Driver: /){ $_ = $l; @@ -41,11 +39,17 @@ while($_=shift @lines){ $driver = $_; } if($l =~ m/^Devices: /){ - $_ = $l; - s/^Devices: //; - parse_devices($_); + $l =~ s/^Devices: //; + parse_devices($l); } $l=""; + $mode = 0; + $_ = $line; + if( m/^[\w-]+: / ){ + chomp; + $l=$_; + $mode = 1; + } } } }