Hello community,

here is the log from the commit of package dpic for openSUSE:Factory checked in 
at 2012-02-29 14:06:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/dpic (Old)
 and      /work/SRC/openSUSE:Factory/.dpic.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "dpic", Maintainer is ""

Changes:
--------
--- /work/SRC/openSUSE:Factory/dpic/dpic.changes        2011-12-12 
16:59:06.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.dpic.new/dpic.changes   2012-02-29 
14:06:33.000000000 +0100
@@ -0,0 +1,11 @@
+Fri Feb 17 16:01:54 UTC 2012 - [email protected]
+
+- update to version 2012.02.12
+  * Fixed a mishandling of null macro arguments in loops.
+
+-------------------------------------------------------------------
+Thu Dec  8 13:18:46 UTC 2011 - [email protected]
+
+- update to version 2011.12.06
+  * changes in documents
+
@@ -9,0 +21 @@
+  * changes in documents
@@ -20,0 +33 @@
+  * changes in documents

Old:
----
  dpic-2011.07.11.tar.gz

New:
----
  dpic-2012.02.12.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ dpic.spec ++++++
--- /var/tmp/diff_new_pack.jAZz9j/_old  2012-02-29 14:06:35.000000000 +0100
+++ /var/tmp/diff_new_pack.jAZz9j/_new  2012-02-29 14:06:35.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package dpic
 #
-# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,12 +16,13 @@
 #
 
 
+
 Name:           dpic
 Url:            http://www.ece.uwaterloo.ca/~aplevich/dpic/
 Summary:        Pic language processor
 License:        BSD-2-Clause
 Group:          Productivity/Publishing/Other
-Version:        2011.07.11
+Version:        2012.02.12
 Release:        0
 Source0:        %name-%{version}.tar.gz
 Patch0:         makefile.patch

++++++ dpic-2011.07.11.tar.gz -> dpic-2012.02.12.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dpic/CHANGES new/dpic/CHANGES
--- old/dpic/CHANGES    2011-07-12 02:15:50.000000000 +0200
+++ new/dpic/CHANGES    2012-02-12 18:31:14.000000000 +0100
@@ -2,6 +2,9 @@
 those shown correspond to changes (usually of documents) not involving
 functionality.
 
+2012 02 07 Fixed a mishandling of null macro arguments in loops.
+2011 12 09 Fix to handle reference to invalid predefined variables gracefully.
+2011 10 25 Bugfixes: exec "string"
 2011 05 31 Basic hash and faster search for variables, at the expense of
    increased storage for [ ] blocks. Adjusted svg size parameters.
 2011 03 17 Compile #elif for OpenBSD
Files old/dpic/doc/dpicdoc.pdf and new/dpic/doc/dpicdoc.pdf differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dpic/doc/quick.pic new/dpic/doc/quick.pic
--- old/dpic/doc/quick.pic      2011-07-12 02:15:50.000000000 +0200
+++ new/dpic/doc/quick.pic      2012-02-12 18:31:14.000000000 +0100
@@ -1,6 +1,6 @@
 .PS                            # Pic input begins with .PS
-# cct_init Version 7.0: PSTricks m4 macro settings used.
-# gen_init Version 7.0: PSTricks m4 macro settings used.
+# cct_init Version 7.2: PSTricks m4 macro settings used.
+# gen_init Version 7.2: PSTricks m4 macro settings used.
 
   define rpoint__ {
     rp_wid = last line.end.x-last line.start.x
@@ -33,31 +33,31 @@
   { line to 
(Here.x,Here.y)+((rp_len/2-(0.25*linewid))*(cos(rp_ang)),(rp_len/2-(0.25*linewid))*(sin(rp_ang)))
     move to 
(Here.x,Here.y)+(((0.25*linewid))*(cos(rp_ang)),((0.25*linewid))*(sin(rp_ang)))
   { circle rad (0.25*linewid)  at Here }
-  
+    
   line from 
(Here.x,Here.y)+(((0.25*linewid))*(cos(rp_ang)),((0.25*linewid))*(sin(rp_ang))) 
to (Here.x,Here.y)+((rp_len/2)*(cos(rp_ang)),(rp_len/2)*(sin(rp_ang)))} 
   { [box invis wid (0.25*linewid)*2 ht (0.25*linewid)*2] at 
(Here.x,Here.y)+((rp_len/2)*(cos(rp_ang)),(rp_len/2)*(sin(rp_ang))) }
   line to (Here.x,Here.y)+((rp_len)*(cos(rp_ang)),(rp_len)*(sin(rp_ang))) 
invis ;  {"$ -$" \
      at last [].s rjust below }; {"$ v_s$" \
      at last [].w rjust }; {"$ +$" \
      at last [].n rjust above }; 
-     line invis   right elen
+      line invis   right elen
   rpoint__
   
    
-              if linewid/24*6*2 > rp_len then { line invis to 
(Here.x,Here.y)+((linewid/24*6*2)*(cos(rp_ang)),(linewid/24*6*2)*(sin(rp_ang)))
+          if linewid/6/4*6*2 > rp_len then { line invis to 
(Here.x,Here.y)+((linewid/6/4*6*2)*(cos(rp_ang)),(linewid/6/4*6*2)*(sin(rp_ang)))
   rpoint__
   
     }
     M4_xyO: last line.c
-    { line from last line.start to 
M4_xyO+(((linewid/24)*(-6))*(cos(rp_ang)),((linewid/24)*(-6))*(sin(rp_ang)))\
-       then to 
M4_xyO+(((linewid/24)*(-5))*(cos(rp_ang))+((linewid/24)*((2)))*((-sin(rp_ang))),((linewid/24)*(-5))*(sin(rp_ang))+((linewid/24)*((2)))*(cos(rp_ang)))
 \
-         then to 
M4_xyO+(((linewid/24)*(-3))*(cos(rp_ang))+((linewid/24)*((-2)))*((-sin(rp_ang))),((linewid/24)*(-3))*(sin(rp_ang))+((linewid/24)*((-2)))*(cos(rp_ang)))
 \
-   then to 
M4_xyO+((-(linewid/24))*(cos(rp_ang))+((linewid/24)*((2)))*((-sin(rp_ang))),(-(linewid/24))*(sin(rp_ang))+((linewid/24)*((2)))*(cos(rp_ang)))
 \
-         then to 
M4_xyO+((linewid/24)*(cos(rp_ang))+((linewid/24)*((-2)))*((-sin(rp_ang))),(linewid/24)*(sin(rp_ang))+((linewid/24)*((-2)))*(cos(rp_ang)))
 \
-   then to 
M4_xyO+(((linewid/24)*(3))*(cos(rp_ang))+((linewid/24)*((2)))*((-sin(rp_ang))),((linewid/24)*(3))*(sin(rp_ang))+((linewid/24)*((2)))*(cos(rp_ang)))
 \
-         then to 
M4_xyO+(((linewid/24)*(5))*(cos(rp_ang))+((linewid/24)*((-2)))*((-sin(rp_ang))),((linewid/24)*(5))*(sin(rp_ang))+((linewid/24)*((-2)))*(cos(rp_ang)))
 \
-        then to 
M4_xyO+(((linewid/24)*(6))*(cos(rp_ang)),((linewid/24)*(6))*(sin(rp_ang))) then 
to last line.end
-      [box invis ht linewid/24*2*2 wid linewid/24*6*2] at 2nd last line.c
+    { line from last line.start to 
M4_xyO+(((linewid/6/4)*(-6))*(cos(rp_ang)),((linewid/6/4)*(-6))*(sin(rp_ang)))\
+       then to 
M4_xyO+(((linewid/6/4)*(-5))*(cos(rp_ang))+((linewid/6/4)*((2)))*((-sin(rp_ang))),((linewid/6/4)*(-5))*(sin(rp_ang))+((linewid/6/4)*((2)))*(cos(rp_ang)))
 \
+         then to 
M4_xyO+(((linewid/6/4)*(-3))*(cos(rp_ang))+((linewid/6/4)*((-2)))*((-sin(rp_ang))),((linewid/6/4)*(-3))*(sin(rp_ang))+((linewid/6/4)*((-2)))*(cos(rp_ang)))
 \
+   then to 
M4_xyO+((-(linewid/6/4))*(cos(rp_ang))+((linewid/6/4)*((2)))*((-sin(rp_ang))),(-(linewid/6/4))*(sin(rp_ang))+((linewid/6/4)*((2)))*(cos(rp_ang)))
 \
+         then to 
M4_xyO+((linewid/6/4)*(cos(rp_ang))+((linewid/6/4)*((-2)))*((-sin(rp_ang))),(linewid/6/4)*(sin(rp_ang))+((linewid/6/4)*((-2)))*(cos(rp_ang)))
 \
+   then to 
M4_xyO+(((linewid/6/4)*(3))*(cos(rp_ang))+((linewid/6/4)*((2)))*((-sin(rp_ang))),((linewid/6/4)*(3))*(sin(rp_ang))+((linewid/6/4)*((2)))*(cos(rp_ang)))
 \
+         then to 
M4_xyO+(((linewid/6/4)*(5))*(cos(rp_ang))+((linewid/6/4)*((-2)))*((-sin(rp_ang))),((linewid/6/4)*(5))*(sin(rp_ang))+((linewid/6/4)*((-2)))*(cos(rp_ang)))
 \
+        then to 
M4_xyO+(((linewid/6/4)*(6))*(cos(rp_ang)),((linewid/6/4)*(6))*(sin(rp_ang))) 
then to last line.end
+      [box invis ht linewid/6/4*2*2 wid linewid/6/4*6*2] at 2nd last line.c
       }
   
   
@@ -71,7 +71,7 @@
   rpoint__
   
    
-    {       line to 
(Here.x,Here.y)+((rp_len/2-linewid/3*0.3/2)*(cos(rp_ang)),(rp_len/2-linewid/3*0.3/2)*(sin(rp_ang)))
+      {           line to 
(Here.x,Here.y)+((rp_len/2-linewid/3*0.3/2)*(cos(rp_ang)),(rp_len/2-linewid/3*0.3/2)*(sin(rp_ang)))
       {line from 
(Here.x,Here.y)+((-linewid/3/2)*((-sin(rp_ang))),(-linewid/3/2)*(cos(rp_ang))) 
to (Here.x,Here.y)+((linewid/3/2)*((-sin(rp_ang))),(linewid/3/2)*(cos(rp_ang)))}
       move to 
(Here.x,Here.y)+((linewid/3*0.3)*(cos(rp_ang)),(linewid/3*0.3)*(sin(rp_ang)))
       {line from 
(Here.x,Here.y)+((-linewid/3/2)*((-sin(rp_ang))),(-linewid/3/2)*(cos(rp_ang))) 
to (Here.x,Here.y)+((linewid/3/2)*((-sin(rp_ang))),(linewid/3/2)*(cos(rp_ang)))}
@@ -94,7 +94,8 @@
   
    
       { line to 
(Here.x,Here.y)+(((rp_len-4*linewid/16*2)/2)*(cos(rp_ang)),((rp_len-4*linewid/16*2)/2)*(sin(rp_ang)))
-   {line to (Here.x,Here.y)+((-linethick/2 
*(scale/72))*((-sin(rp_ang))),(-linethick/2 *(scale/72))*(cos(rp_ang)))};   for 
m4i=1 to 4 do {
+   {line to (Here.x,Here.y)+((-linethick/2 
*(scale/72))*((-sin(rp_ang))),(-linethick/2 *(scale/72))*(cos(rp_ang)))};
+   for m4i=1 to 4 do {
      arc cw from Here to 
(Here.x,Here.y)+((linewid/16*2)*(cos(rp_ang)),(linewid/16*2)*(sin(rp_ang))) 
with .c at 
(Here.x,Here.y)+((linewid/16)*(cos(rp_ang)),(linewid/16)*(sin(rp_ang)))
      {line to (Here.x,Here.y)+((-linethick/2 
*(scale/72))*((-sin(rp_ang))),(-linethick/2 *(scale/72))*(cos(rp_ang)))} }
    line to 
(Here.x,Here.y)+(((rp_len-4*linewid/16*2)/2)*(cos(rp_ang)),((rp_len-4*linewid/16*2)/2)*(sin(rp_ang)))}
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dpic/dpic.c new/dpic/dpic.c
--- old/dpic/dpic.c     2011-07-12 02:15:50.000000000 +0200
+++ new/dpic/dpic.c     2012-02-12 18:31:14.000000000 +0100
@@ -57,7 +57,7 @@
 /* Some PC versions of p2c crash on Pascal const declarations at low levels.
    All consts should be in dp0.x */
 
-#define Version         "dpic version 2011.07.11"
+#define Version         "dpic version 2012.02.12"
 
 /* UMBX distmax = 1E25; XBMU */
 
@@ -1383,8 +1383,8 @@
   /*D if debuglevel > 0 then writeln(log,'stackhigh=',stackhigh:1);D*/
   /* D writeln("stackhigh=",stackhigh:1); D */
   /* Seems needed for some Cygwin machines: */
-  /*H flush(stderr);
-  flush(stdout) H*/
+  /* GH flush(stderr);
+  flush(stdout) HG */
 }
 
 
@@ -1942,7 +1942,13 @@
          if lv = nil then write(log,' nil');
          while lv <> nil do begin
             write(log,' (',ordp(lv):1,',',ordp(lv^.next):1,')=');
-            with lv^ do snapname(segmnt,seginx,len);
+            with lv^ do begin
+snapname(segmnt,seginx,len);
+write(log,'='); wfloat(log,val)
+end;
+            D*/
+/* writeln(log); */
+/*D
             lv := lv^.next
             end;
          writeln(log)
@@ -2068,7 +2074,7 @@
       markerror(852);
     else {
       *x = (long)floor(*x + 0.5) % (long)floor(y + 0.5);
-/* p2c: dpic.p, line 1024:
+/* p2c: dpic.p, line 1029:
  * Note: Using % for possibly-negative arguments [317] */
     }
     break;
@@ -2291,7 +2297,7 @@
 }
 
 
-int varindex(Char *chb, chbufinx chbufx, chbufinx length)
+int varhash(Char *chb, chbufinx chbufx, chbufinx length)
 {
   int idx;
 
@@ -2303,7 +2309,7 @@
   if (length > 2)
     idx += chb[chbufx + length - 2];
   return (idx % (HASHLIM + 1));
-/* p2c: dpic.p, line 1154:
+/* p2c: dpic.p, line 1159:
  * Note: Using % for possibly-negative arguments [317] */
 }
 
@@ -2315,7 +2321,7 @@
   int left, right, midpt, i, idx;
   nametype *WITH;
 
-  idx = varindex(chb, chbufx, length);
+  idx = varhash(chb, chbufx, length);
   /*D if debuglevel > 0 then begin
       write(log,' findname|');
       for i:= chbufx to chbufx-1+length do write(log,chb^[i]);
@@ -3789,7 +3795,7 @@
     i = -i;
   do {
     buf[*inx + j] = i % 10 + '0';
-/* p2c: dpic.p, line 1991:
+/* p2c: dpic.p, line 1996:
  * Note: Using % for possibly-negative arguments [317] */
     j--;
     i /= 10;
@@ -4093,8 +4099,8 @@
        if ((attstack[i].lexval == XLendfor || attstack[i].lexval == XFOR ||
             attstack[i].lexval == XLBRACE ||
             attstack[i].lexval == XSEMICOLON ||
-            attstack[i].lexval == XNL) && attstack[i].prim == NULL) {
-         /*repeat ,Xrepeat */
+            attstack[i].lexval == XNL) && attstack[i].prim == NULL)
+       {   /*repeat ,Xrepeat */
          i--;
          continue;
        }
@@ -4166,7 +4172,7 @@
     } else {
       WITH->xval = (long)floor(WITH->xval + 0.5) %
                   (long)floor(attstack[newp + 2].xval + 0.5);
-/* p2c: dpic.p, line 2249:
+/* p2c: dpic.p, line 2253:
  * Note: Using % for possibly-negative arguments [317] */
     }
     break;
@@ -4333,6 +4339,7 @@
        }
       }
     }
+    WITH->lexval = XLBRACE;
     break;
     /*              | loop "}" */
     /*              | break */
@@ -4706,23 +4713,24 @@
   case assignment2:
     if (attstack[newp + 1].lexval != XEMPTY)
       addsuffix(chbuf, &WITH->chbufx, &WITH->length, attstack[newp + 1].xval);
-    if (attstack[newp + 2].lexval == XEQ) {
-      /* varname := findname(envblock^.vars,chbuf,chbufx,length,lastvar,k) */
-      WITH->varname = findname(envblock, chbuf, WITH->chbufx, WITH->length,
-                              &lastvar, &k);
-    } else
-      WITH->varname = glfindname(envblock, chbuf, WITH->chbufx, WITH->length,
-                                &lastvar, &k);
+    WITH->varname = findname(envblock, chbuf, WITH->chbufx, WITH->length,
+                            &lastvar, &k);
+    if (WITH->varname == NULL && attstack[newp + 2].lexval != XEQ)
+      WITH->varname = glfindname(envblock->parent, chbuf, WITH->chbufx,
+                                WITH->length, &namptr, &kk);
     if (WITH->varname == NULL) {
       newstr(&WITH->varname);
-      j = varindex(chbuf, WITH->chbufx, WITH->length);
+      j = varhash(chbuf, WITH->chbufx, WITH->length);
       storestring(&freeseg, WITH->varname, chbuf, WITH->chbufx, WITH->length);
       WITH2 = envblock;
-      /*D if debuglevel > 1 then
-         write(log,'assignment1: envblock=',ordp(envblock):1,
-                    ' lastvar=',ordp(lastvar):1,' k=',k:1); D*/
+      /*D if debuglevel > 1 then begin
+          writeln(log,'assignment1: envblock=',ordp(envblock):1,
+                  ' eqstr val=',k:1);
+          write(log,' lastvar=',ordp(lastvar):1);
+                  if lastvar<>nil then with lastvar^ do
+                    snapname(segmnt,seginx,len); writeln(log) end; D*/
       /*D if debuglevel > 1 then begin writeln(log,
-          ' varname=',ordp(varname):1); prvars(newp) end; D*/
+                   ' varname=',ordp(varname):1); prvars(newp) end; D*/
       if (lastvar == NULL)
        WITH2->UU.UEMPTY6.vars[j] = WITH->varname;
       else if (k < 0) {
@@ -4737,6 +4745,7 @@
        WITH2->UU.UEMPTY6.vars[j] = WITH->varname;
       } else {
        namptr = WITH2->UU.UEMPTY6.vars[j];
+       /* while (namptr^.next<>nil) and (namptr^.next<>lastvar) do */
        while (namptr->next_ != lastvar)
          namptr = namptr->next_;
        namptr->next_ = WITH->varname;
@@ -4753,27 +4762,6 @@
     WITH->xval = WITH->varname->val;
     break;
 
-  /*
-     assignment1,assignment2: begin
-        if attstack^[newp+1].lexval <> XEMPTY then
-           addsuffix(chbuf,chbufx,length,attstack^[newp+1].xval);
-        if attstack^[newp+2].lexval = XEQ then
-           varname := findname(envblock^.vars,chbuf,chbufx,length,lastn)
-        else
-           varname := glfindname(envblock,chbuf,chbufx,length,lastn);
-        if varname = nil then begin
-           newstr(varname);
-           addstring(freeseg,varname,chbuf,chbufx,length);
-           if lastn = nil then envblock^.vars := varname
-           else lastn^.next := varname;
-           varname^.val := 0
-           end;
-        if attstack^[newp+2].lexval = XEQ then
-           varname^.val := attstack^[newp+3].xval
-        else
-           eqop(varname^.val,attstack^[newp+2].lexval,attstack^[newp+3].xval);
-        xval := varname^.val
-        end; */
   /*                 | "<envvar>" "=" expression   */
   /*                 | "<envvar>" "=" assignment   */
   case assignment3:
@@ -7458,7 +7446,7 @@
     case XLpmod:
       j = labs((long)floor(attstack[newp + 4].xval + 0.5));
       i = (long)floor(attstack[newp + 2].xval + 0.5) % j;
-/* p2c: dpic.p, line 4223:
+/* p2c: dpic.p, line 4212:
  * Note: Using % for possibly-negative arguments [317] */
       if (i >= 0)
        WITH->xval = i;
@@ -8851,7 +8839,7 @@
   if (errmp > 0)
     writeerror();
   return p;
-  /*D; if debuglevel = 2 then writeln(log,'newinbuf[',ordp(p):1,']') D*/
+  /*D; if debuglevel = 2 then writeln(log,'new(next)inbuf[',ordp(p):1,']') D*/
 }
 
 
@@ -9251,7 +9239,7 @@
   /*D if debuglevel > 0 then begin
       write(log, 'findarg(');
       if arlst = nil then write(log,'nil') else write(log,ordp(arlst):1);
-      write(log,',',k:1,')=') end; D*/
+      write(log,',',k:1,'):') end; D*/
   if (k > 0)
     ar = arlst;
   else
@@ -9429,118 +9417,146 @@
       end
    end; D*/
 
+/*
+function nbuf(buf: fbufferp): fbufferp;
+var ml: fbufferp;
+begin
+   newbuf(ml); with ml^ do begin
+      attrib := buf^.attrib; savedlen := CHBUFSIZ;
+      readx := CHBUFSIZ+1; nextb := buf end;
+   buf^.prevb := ml;
+   nbuf := ml
+   end;
+*/
 fbuffer *nbuf(fbuffer *buf)
 {
-  fbuffer *ml;
+  fbuffer *WITH;
 
-  newbuf(&ml);
-  ml->attrib = buf->attrib;
-  ml->savedlen = CHBUFSIZ;
-  ml->readx = CHBUFSIZ + 1;
-  ml->nextb = buf;
-  buf->prevb = ml;
-  return ml;
+  if (buf->prevb == NULL)
+    newbuf(&buf->prevb);
+  WITH = buf->prevb;
+  WITH->attrib = buf->attrib;
+  WITH->savedlen = CHBUFSIZ;
+  WITH->readx = CHBUFSIZ + 1;
+  WITH->nextb = buf;
+  return (buf->prevb);
 }
 
 
 void copyleft(fbuffer *mac, fbuffer **buf)
 {
   /* mac: fbufferp; var buf: fbufferp */
-  /* Push macro from mac into the head of the input stream */
+  /* Push macro or arg or string from mac into the head of the input stream */
   fbuffer *ml;
-  int i;
-  boolean nflag;
-  int FORLIM;
+  int i, k;
+  boolean newflag, copied;
   fbuffer *WITH;
+  int FORLIM;
 
   /*D if debuglevel > 0 then writeln(log, 'copyleft:'); D*/
   /*D if debuglevel > 1 then begin
      write(log,' input string'); wrbuf(mac,3,1);
-     write(log,' output '); wrbuf(buf,3,1) end; D*/
+     write(log,' output'); wrbuf(buf,3,1) end; D*/
   writeerror();
   ml = mac;
   while (ml != NULL) {
     mac = ml;
     ml = ml->nextb;
   }
+  copied = false;
   while (mac != NULL) {
     if (mac->carray != NULL) {
-      FORLIM = mac->readx;
-      for (i = mac->savedlen; i >= FORLIM; i--) {
+      if (mac->savedlen >= mac->readx) {
+       copied = true;
        if (*buf == NULL)
-         nflag = true;
+         newflag = true;
        else if ((*buf)->attrib >= 0)
-         nflag = true;
+         newflag = true;   /* for body */
        else
-         nflag = false;
-       if (nflag) {
-         /*D if debuglevel > 0 then
-            writeln(log,'nflag=',nflag:1,' attrib=',buf^.attrib:1); D*/
+         newflag = false;
+       /*D if debuglevel > 0 then
+          writeln(log,'newflag=',newflag:1,' attrib=',buf^.attrib:1); D*/
+       if (newflag) {
          newbuf(&ml);
          ml->attrib = -1;
          ml->savedlen = CHBUFSIZ;
          ml->readx = CHBUFSIZ + 1;
-         ml->higherb = *buf;
+         ml->higherb = *buf;   /*nextb*/
          *buf = ml;
-       } else if ((*buf)->readx <= 1 && (*buf)->prevb != NULL) {
-         WITH = (*buf)->prevb;
-         WITH->attrib = (*buf)->attrib;
-         WITH->savedlen = CHBUFSIZ;
-         WITH->readx = CHBUFSIZ + 1;
-         WITH->nextb = *buf;
-         *buf = (*buf)->prevb;
-       } else if ((*buf)->readx <= 1)
-         *buf = nbuf(*buf);
+       }
+      }
+      k = mac->savedlen;
+      if ((*buf)->readx < k - mac->readx + 2) {  /*not enough space*/
        WITH = *buf;
+       while (WITH->readx > 1) {
+         WITH->readx--;
+         WITH->carray[WITH->readx] = mac->carray[k];
+         k--;
+       }
+       *buf = nbuf(*buf);
+      }
+      WITH = *buf;
+      FORLIM = mac->readx;
+      for (i = k; i >= FORLIM; i--) {
        WITH->readx--;
        WITH->carray[WITH->readx] = mac->carray[i];
       }
     }
     mac = mac->prevb;
   }
+  if (!copied)
+    return;
+  /*D; if debuglevel > 0 then begin
+     ml := buf; writeln(log,' copyleft result'); while ml <> nil do begin
+        wrbuf(ml,3,1); ml := ml^.nextb end end D*/
   if ((*buf)->readx <= 1)
     *buf = nbuf(*buf);
   WITH = *buf;
-  /*D; if debuglevel > 0 then begin
-     ml := buf; write(log,' copyleft result'); while ml <> nil do begin
-        wrbuf(ml,3,1); ml := ml^.nextb end end D*/
   WITH->carray[WITH->readx - 1] = nlch;
 }
 
 
 void copyright(fbuffer *mac, fbuffer **buf)
 {
-  /* Push macro into the tail of the input buffer */
+  /* $n has been seen: Push the argument into the tail of the input buffer */
   fbuffer *ml;
-  int i;
+  int i, k;
   fbuffer *WITH;
+  int FORLIM;
 
   /*D if debuglevel > 0 then begin
      writeln(log, 'copyright:');
      write(log,' input'); wrbuf(mac,3,1);
      write(log,' output'); wrbuf(buf,3,0) end; D*/
   while (mac != NULL) {
-    i = mac->readx;
-    while (i <= mac->savedlen) {
-      if (*buf == NULL) {
-       newbuf(buf);
-       WITH = *buf;
-       WITH->attrib = -1;
-       WITH->savedlen = 0;
-       WITH->readx = 1;
-      } else if ((*buf)->savedlen >= CHBUFSIZ) {
-       newbuf(&ml);
-       ml->attrib = (*buf)->attrib;
-       ml->savedlen = 0;
-       ml->readx = 1;
-       ml->prevb = *buf;
-       (*buf)->nextb = ml;
-       *buf = ml;
-      }
+    if (*buf == NULL) {
+      newbuf(buf);
       WITH = *buf;
+      WITH->attrib = -1;
+      WITH->savedlen = 0;
+      WITH->readx = 1;
+    }
+    k = mac->readx;
+    if (CHBUFSIZ - (*buf)->savedlen <= mac->savedlen - k) {
+      WITH = *buf;
+      while (WITH->savedlen < CHBUFSIZ) {
+       WITH->savedlen++;
+       WITH->carray[WITH->savedlen] = mac->carray[k];
+       k++;
+      }
+      newbuf(&ml);
+      ml->attrib = (*buf)->attrib;
+      ml->savedlen = 0;
+      ml->readx = 1;
+      ml->prevb = *buf;
+      (*buf)->nextb = ml;
+      *buf = ml;
+    }
+    WITH = *buf;
+    FORLIM = mac->savedlen;
+    for (i = k; i <= FORLIM; i++) {
       WITH->savedlen++;
       WITH->carray[WITH->savedlen] = mac->carray[i];
-      i++;
     }
     mac = mac->nextb;
   }
@@ -9664,10 +9680,8 @@
            inchar();
          }
          ar = findarg(args, n);
-         if (ar != NULL) {
-           /* else markerror(805) */
+         if (ar != NULL)
            copyright(ar->argbody, &p1);
-         }
        } else {
          WITH->savedlen++;
          WITH->carray[WITH->savedlen] = prevch;
@@ -9758,10 +9772,8 @@
   ar = findarg(args, n);
   backup();
   if (ar != NULL) {
-    if (ar->argbody != NULL) {
-      /* else markerror(805) */
+    if (ar->argbody != NULL)
       copyleft(ar->argbody, &inbuf);
-    }
   }
 }
 
@@ -10063,20 +10075,23 @@
 }
 
 
-/* Stuff the body of a for loop or a macro body into p2
-   attx: attstack index or -(name length)
-   p0 = nil: append the output to this buffer.
-   Should we check for macro arguments? */
-
 void readfor(fbuffer *p0, int attx, fbuffer **p2)
 {
   /* p0: fbufferp; attx: integer; var p2: fbufferp */
+  /* Stuff the body of a for loop or a macro body into p2
+     attx: attstack index or -(name length)
+     p0 = nil: append the output to this buffer.
+     Should we check for macro arguments? */
   int j, bracelevel;
   fbuffer *p, *p1;
   boolean instring;
   Char prevch;
 
-  /*D if debuglevel = 2 then writeln(log,'readfor: attx', attx:5 ); D*/
+  /*D if debuglevel = 2 then begin
+      write(log,'readfor: attx(');
+      if attx<0 then write(log,'-length)=') else write(log,'attstack idx)=');
+      writeln(log,attx:5)
+      end; D*/
   writeerror();
   prevch = ' ';
   instring = false;
@@ -10143,6 +10158,8 @@
 
 void bumptop(stackinx chk, stackinx *sttop)
 {
+  /* D if chk<>sttop then
+     writeln(stderr,'chk=',chk:4,' sttop=',sttop:4); D */
   if (chk < STACKMAX)
     (*sttop)++;
   else
@@ -10535,7 +10552,7 @@
       /* writeln(stderr,'     -d pdftex graphicx output'); */
       fprintf(stderr_, "     -e pict2e output\n");
       fprintf(stderr_, "     -f Postscript output, psfrag strings\n");
-      fprintf(stderr_, "     -g PGF output\n");
+      fprintf(stderr_, "     -g PGF-TikZ output\n");
       fprintf(stderr_, "     -h write this message and quit\n");
       fprintf(stderr_, "     -m mfpic output\n");
       fprintf(stderr_, "     -p PSTricks output\n");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dpic/dpic2.c new/dpic/dpic2.c
--- old/dpic/dpic2.c    2011-07-12 02:15:50.000000000 +0200
+++ new/dpic/dpic2.c    2012-02-12 18:31:14.000000000 +0100
@@ -17,7 +17,7 @@
 #include <time.h>
 
 
-#define Version         "dpic version 2011.07.11"
+#define Version         "dpic version 2012.02.12"
 
 /* UMBX distmax = 1E25; XBMU */
 
@@ -2435,7 +2435,7 @@
 }
 
 
-void svgfilloptions(primitive *node, int lnspec)
+void svgfilloptions(primitive *node, int lnspec, boolean poly)
 {
   double fill;
 
@@ -2487,7 +2487,14 @@
     printf("<path");
     break;
 
-  /* XLline,XLarrow: ; */
+  case XLline:
+  case XLarrow:
+    if (poly)
+      printf("<polyline");
+    else
+      printf("<line");
+    break;
+
   case XLarc:
     printf("<path");
     break;
@@ -2605,7 +2612,7 @@
       printf(" font-size=\"");
       wfloat(&output, textht / scale * 72);
       printf("pt\"");
-      svgfilloptions(node, lspec(node->spec));
+      svgfilloptions(node, lspec(node->spec), false);
       if (node->lthick < 0)
        svgsetstroke(0.2);
     }
@@ -2851,7 +2858,7 @@
     else
       v = drawn(node, lnspec, node->UU.Ubox.boxfill);
     if (v) {
-      svgfilloptions(node, lnspec);
+      svgfilloptions(node, lnspec, false);
       svgcoord("x", "y", node->aat.xpos - fabs(node->UU.Ubox.boxwidth) / 2,
               node->aat.ypos + fabs(node->UU.Ubox.boxheight) / 2);
       if (node->UU.Ubox.boxradius > 0.0) {
@@ -2867,7 +2874,7 @@
 
   case XLellipse:
     if (drawn(node, lnspec, node->UU.Uellipse.efill)) {
-      svgfilloptions(node, lnspec);
+      svgfilloptions(node, lnspec, false);
       svgcoord("cx", "cy", node->aat.xpos, node->aat.ypos);
       svgparam("rx", 0.5 * fabs(node->UU.Uellipse.elwidth));
       svgparam("ry", 0.5 * fabs(node->UU.Uellipse.elheight));
@@ -2878,7 +2885,7 @@
 
   case XLcircle:
     if (drawn(node, lnspec, node->UU.Ucircle.cfill)) {
-      svgfilloptions(node, lnspec);
+      svgfilloptions(node, lnspec, false);
       svgcoord("cx", "cy", node->aat.xpos, node->aat.ypos);
       svgparam("r", fabs(node->UU.Ucircle.radius));
       svgendpath();
@@ -2943,7 +2950,7 @@
                   node->UU.Uline.lfill);
        spltot = primdepth(node);
        splcount = spltot;
-       svgfilloptions(node, lnspec);
+       svgfilloptions(node, lnspec, false);
        printf(" d=\"M ");
        svgwpos(node->aat);
        printf("\n C ");
@@ -3026,15 +3033,13 @@
                   qenv(tn, XLarrowwid, tn->UU.Uline.width), lth,
                   node->UU.Uline.lfill);
        if (node->son == NULL) {
-         printf("<line");
-         svgfilloptions(tn, lnspec);
+         svgfilloptions(tn, lnspec, false);
          svgcoord("x1", "y1", node->aat.xpos, node->aat.ypos);
          svgcoord("x2", "y2", node->UU.Uline.endpos.xpos,
                   node->UU.Uline.endpos.ypos);
          svgendpath();
        } else {
-         printf("<polyline");
-         svgfilloptions(tn, lnspec);
+         svgfilloptions(tn, lnspec, true);
          printf(" points=\"");
          svgwpos(node->aat);
          space();
@@ -5805,7 +5810,7 @@
   }
   if (ss == NULL)
     return;
-  printf(" gsave\n");   /* write(' currentrgbcolor '); */
+  printf(" gsave\n");
   wstring(&output, ss);
   printf(" setrgbcolor fill grestore\n");
 }

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to