groff
[Top][All Lists]
Advanced

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

[Groff] bug fix for src/libs/libdriver/input.cc


From: Gaius Mulley
Subject: [Groff] bug fix for src/libs/libdriver/input.cc
Date: Fri, 08 Feb 2002 19:57:26 +0000

Hi Werner,

here is a bug fix for multiple lines of ps exec'ed code.  An example
test (from Steve Blinkhorn) follows the patch.  Feel free to alter the
first 'return buf.make_string();' back to 'break;' if you prefer. I
tend to favour get out of the function asap and let the compiler join
similar statements - but these are akin to favorate color issues :-)

Gaius



--- groff-cvs/src/libs/libdriver/input.cc       Tue Feb  5 15:54:33 2002
+++ groff-html/src/libs/libdriver/input.cc      Fri Feb  8 10:19:04 2002
@@ -751,6 +751,7 @@
 {
   StringBuf buf = StringBuf();
   Char c = next_arg_begin();
+
   while ((int) c != EOF) {
     if ((int) c == '\n') {
       current_lineno++;
@@ -759,10 +760,11 @@
        buf.append((Char) '\n');
       else {
        unget_char(c);          // first character of next line
-       break;
+       return buf.make_string();
       }
     }
-    buf.append(c);
+    else
+      buf.append(c);
     c = get_char();
   }
   return buf.make_string();



----------------------------------------

.LP
.de logodefs
ps: mdef 6
/prop { lscale mul } def
/prop2 {lscale mul 2 mul} def
/inch {72 mul} def
/box
{gsave rlineto
rlineto
rlineto
} def
/fillbox
{ setgray fill grestore } def
..
.de logoset
ps: exec
-2.139 prop 0 0 -2.139 prop 2.139 prop 0 box 
0 fillbox
-0.05 prop2 -0.05 prop2 rmoveto
-2.139 prop 0 0 -2.139 prop 2.139 prop 0 box 
0 fillbox
0.025 prop2 -0.025 prop2 rmoveto
-2.028 prop 0 0 -2.028 prop 2.028 prop 0 box 
1 fillbox
0.020 prop2 -0.025 prop2 rmoveto
-1.944 prop 0 0 -1.944 prop 1.944 prop 0 box 
0 fillbox
0.005 prop2 -0.025 prop2 rmoveto
/Times-Roman findfont lscale scalefont setfont
1 -1 scale
(PRD)
1 setgray
 show
0 setgray
1 -1 scale
..
.de logo
\&
.HTML-IMAGE
\D'l +0 +0'\v'2.2u*\\$1p+1p'
.nr Ls \\$1
.ds l \X'ps: exec /lscale \\n(Ls def'
\\*l\Y[logoset]
\\h'2.2u*\\$1p+1p'\D'l +0 +0'
.HTML-IMAGE-END
..
\Y[logodefs]
.logo 50
.\"
.\" from Steve Blinkhorn <address@hidden>
.\"

reply via email to

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