pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/textproc/rtf-tools Move initialisation of FILE structu...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b170ba3a8353
branches:  trunk
changeset: 505887:b170ba3a8353
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Sun Jan 08 20:52:57 2006 +0000

description:
Move initialisation of FILE structures to run time, stdin and stdout
are not valid rvalues on global scope.

diffstat:

 textproc/rtf-tools/distinfo         |   5 ++-
 textproc/rtf-tools/patches/patch-ae |  41 +++++++++++++++++++++++++++---------
 textproc/rtf-tools/patches/patch-aj |  23 ++++++++++++++++++++
 3 files changed, 56 insertions(+), 13 deletions(-)

diffs (141 lines):

diff -r a1fcfa13d550 -r b170ba3a8353 textproc/rtf-tools/distinfo
--- a/textproc/rtf-tools/distinfo       Sun Jan 08 20:45:45 2006 +0000
+++ b/textproc/rtf-tools/distinfo       Sun Jan 08 20:52:57 2006 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.5 2005/03/28 14:48:23 ben Exp $
+$NetBSD: distinfo,v 1.6 2006/01/08 20:52:57 joerg Exp $
 
 SHA1 (RTF-1.10.tar.Z) = 1fcf63e52bd2d57b2841e32667ab76bb6c2998c6
 RMD160 (RTF-1.10.tar.Z) = 0fdacb6df5779a343d419e1e3bf007f8d8cabbda
@@ -7,8 +7,9 @@
 SHA1 (patch-ab) = c45bc8d80a5c3a5cdf8f54c1c2a91caa81ce0f97
 SHA1 (patch-ac) = ab10d20e7457c978a51288391064d7baef403304
 SHA1 (patch-ad) = 5bffb2788eeba22bc8b46fd55dda25d87d22d9d6
-SHA1 (patch-ae) = 6bb6163020f7961484b14b57fd416538ecfdfcd0
+SHA1 (patch-ae) = 55a14a2b6911d3a4a1251f8d13c39bc1bf54559b
 SHA1 (patch-af) = 428112205e1cf6466c6f97de6102ecd52ae39781
 SHA1 (patch-ag) = 2c5fd9db3c011bb0648b738d09e1342fb6c76003
 SHA1 (patch-ah) = 6a7f28d28bd6b8058c77ae57c5a5d88e1152258e
 SHA1 (patch-ai) = f46a29dbdfd074ee8263b74d40f38c10646037fb
+SHA1 (patch-aj) = 30ee5d5f3b8c283bca4d7959d3d3be3a241de653
diff -r a1fcfa13d550 -r b170ba3a8353 textproc/rtf-tools/patches/patch-ae
--- a/textproc/rtf-tools/patches/patch-ae       Sun Jan 08 20:45:45 2006 +0000
+++ b/textproc/rtf-tools/patches/patch-ae       Sun Jan 08 20:52:57 2006 +0000
@@ -1,20 +1,39 @@
-$NetBSD: patch-ae,v 1.4 2005/03/28 14:48:23 ben Exp $
+$NetBSD: patch-ae,v 1.5 2006/01/08 20:52:57 joerg Exp $
 
---- lib/reader.c.orig  1994-04-05 12:14:55.000000000 -0700
+--- lib/reader.c.orig  1994-04-05 19:14:55.000000000 +0000
 +++ lib/reader.c
-@@ -587,38 +587,45 @@ RTFFont  *fp;
+@@ -137,7 +137,7 @@ static RTFColor    *colorList = (RTFColor *
+ static RTFStyle       *styleList = (RTFStyle *) NULL;
+ 
+ 
+-static FILE   *rtffp = stdin;
++static FILE   *rtffp;
+ 
+ static char   *inputName = (char *) NULL;
+ static char   *outputName = (char *) NULL;
+@@ -207,6 +207,9 @@ RTFFont            *fp;
+ RTFStyle      *sp;
+ RTFStyleElt   *eltList, *ep;
+ 
++      if (rtffp == NULL)
++              rtffp = stdin;
++
+       if (rtfTextBuf == (char *) NULL)        /* initialize the text buffers */
+       {
+               rtfTextBuf = RTFAlloc (rtfBufSiz);
+@@ -587,38 +590,45 @@ RTFFont  *fp;
        if (autoCharSetFlags == 0)
                return;
  
 -      if ((autoCharSetFlags & rtfReadCharSet)
 -              && RTFCheckCM (rtfControl, rtfCharSet))
-+      if (autoCharSetFlags & rtfReadCharSet)
-       {
+-      {
 -              ReadCharSetMaps ();
 -      }
 -      else if ((autoCharSetFlags & rtfSwitchCharSet)
 -              && RTFCheckCMM (rtfControl, rtfCharAttr, rtfFontNum))
--      {
++      if (autoCharSetFlags & rtfReadCharSet)
+       {
 -              if ((fp = RTFGetFont (rtfParam)) != (RTFFont *) NULL)
 +              if (RTFCheckCM (rtfControl, rtfCharSet))
                {
@@ -75,7 +94,7 @@
                }
        }
  }
-@@ -1194,6 +1201,7 @@ RTFFont  *fp;
+@@ -1194,6 +1204,7 @@ RTFFont  *fp;
  char  buf[rtfBufSiz], *bp;
  int   old = -1;
  char  *fn = "ReadFontTbl";
@@ -83,7 +102,7 @@
  
        for (;;)
        {
-@@ -1311,11 +1319,30 @@ char   *fn = "ReadFontTbl";
+@@ -1311,11 +1322,30 @@ char   *fn = "ReadFontTbl";
                                RTFPanic ("%s: missing \"}\"", fn);
                }
        }
@@ -116,7 +135,7 @@
        RTFRouteToken ();       /* feed "}" back to router */
  }
  
-@@ -1375,6 +1402,7 @@ ReadStyleSheet ()
+@@ -1375,6 +1405,7 @@ ReadStyleSheet ()
  RTFStyle      *sp;
  RTFStyleElt   *sep, *sepLast;
  char          buf[rtfBufSiz], *bp;
@@ -124,7 +143,7 @@
  char          *fn = "ReadStyleSheet";
  
        for (;;)
-@@ -1507,8 +1535,10 @@ char            *fn = "ReadStyleSheet";
+@@ -1507,8 +1538,10 @@ char            *fn = "ReadStyleSheet";
                        RTFPanic ("%s: missing style name", fn);
                if (sp->rtfSNum < 0)
                {
@@ -137,7 +156,7 @@
                                RTFPanic ("%s: missing style number", fn);
                        sp->rtfSNum = rtfNormalStyleNum;
                }
-@@ -2260,6 +2290,7 @@ static RTFKey    rtfKey[] =
+@@ -2260,6 +2293,7 @@ static RTFKey    rtfKey[] =
  
        rtfCharSet,     rtfMacCharSet,          "mac",          0,
        rtfCharSet,     rtfAnsiCharSet,         "ansi",         0,
diff -r a1fcfa13d550 -r b170ba3a8353 textproc/rtf-tools/patches/patch-aj
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/textproc/rtf-tools/patches/patch-aj       Sun Jan 08 20:52:57 2006 +0000
@@ -0,0 +1,23 @@
+$NetBSD: patch-aj,v 1.1 2006/01/08 20:52:57 joerg Exp $
+
+--- rtf2text/text-writer.c.orig        2006-01-08 20:50:34.000000000 +0000
++++ rtf2text/text-writer.c
+@@ -53,7 +53,7 @@ static void  PutLitStr ();
+ 
+ static char   *outMap[rtfSC_MaxChar];
+ 
+-static FILE   *ostream = stdout;
++static FILE   *ostream;
+ 
+ 
+ /*
+@@ -63,6 +63,9 @@ static FILE  *ostream = stdout;
+ void
+ WriterInit ()
+ {
++      if (ostream == NULL)
++              ostream = stdout;
++
+       if (RTFReadOutputMap (outputMapName, outMap, 1) == 0)
+               RTFPanic ("Cannot read output map %s", outputMapName);
+ }



Home | Main Index | Thread Index | Old Index