From: ianmdlvl Date: Wed, 24 Mar 2004 01:00:50 +0000 (+0000) Subject: readahead to cope with plusses; no y2tics if unneeded X-Git-Tag: debian_version_4_0_99_0_6~11 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=chiark-utils.git;a=commitdiff_plain;h=d111bcddaa0cb7c81a9857642e08512adf224a19 readahead to cope with plusses; no y2tics if unneeded --- diff --git a/scripts/gnucap2gnuplot b/scripts/gnucap2gnuplot index 9d909ca..7e97b49 100755 --- a/scripts/gnucap2gnuplot +++ b/scripts/gnucap2gnuplot @@ -105,7 +105,6 @@ sub startplot () { open S, "> $ofb,$cplot.gnuplot-cmd" or die $!; print S < $ofb,$cplot-$yn.gnuplot-data" or die $!; @@ -149,8 +148,20 @@ sub endplot () { $kind= undef; } -while () { +$readahead= ; +for (;;) { + $linesofar= $readahead; + for (;;) { + $readahead= ; + last unless $readahead =~ s/^\+//; + die unless length $linesofar; + $linesofar =~ s/\n$//; + $linesofar .= $readahead; + } + $_= $linesofar; + last unless length; s/\s+$//; + if (m/^\#(\w+)/) { endplot(); $kind= $1; @@ -196,4 +207,4 @@ $?=0; close STDIN; $? and fail("gnucap failed (code $?)"); $sof= "./$sof" unless $sof =~ m,/,; print ": generated ; $sof\n" or die $!; -# $Id: gnucap2gnuplot,v 1.2 2004-03-23 23:03:06 ianmdlvl Exp $ +# $Id: gnucap2gnuplot,v 1.3 2004-03-24 01:00:50 ianmdlvl Exp $