[xml] patch: xmlcatalog core dump



hi daniel,

when one runs xmlcatalog like this :
  xmlcatalog --noout --add "..." "..." "..."
means forgetting the final filename, the tool core-dumps :
  add command failed
  could not open Segmentation fault (core dumped)

The attached patch fixes this (sorry the patch is against version 2.5.11). I
hadn't time to update yet. Will likely work anyway as its only a small change.

ciao
  Stefan
-- 
      \|/            Stefan Kost
     <@ @>           private            business
+-oOO-(_)-OOo------------------------------------------------------ - - -  -   -
|       __  Address  Simildenstr. 5     HTWK Leipzig, Fb IMN, Postfach 301166
|      ///           04277 Leipzig      04251 Leipzig
| __  ///            Germany            Germany
| \\\///    Phone    +49341 2253538     +49341 30766101
|  \__/     EMail    st_kost_at_gmx.net kost_at_imn.htwk-leipzig.de
|           WWW      www.sonicpulse.de  www.imn.htwk-leipzig.de/~kost/about.html
===-=-=--=---=---------------------------------- - - -  -    -
--- xmlcatalog.orig.c   Fri Dec 12 15:02:08 2003
+++ xmlcatalog.c        Fri Dec 12 15:03:37 2003
@@ -37,7 +37,7 @@
 static int del = 0;
 static int convert = 0;
 static int verbose = 0;
-static char *filename;
+static char *filename = NULL;
 
 #ifdef LIBXML_CATALOG_ENABLED
 
@@ -556,7 +556,7 @@
        }
     }
     if ((!sgml) && ((add) || (del) || (create) || (convert))) {
-       if (noout) {
+       if (noout && filename && *filename) {
            FILE *out;
 
            out = fopen(filename, "w");


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