Fixes for few small bugs that can crop up when importing .general
files.  

    In the first, watch out for lines that are just "\n", and in the
second, don't poke around in _dxd_gi_filename after freeing it.

Randall


-- 
Randall Hopper (mailto:[EMAIL PROTECTED])
EPA Scientific Visualization Center
US EPA MD/24 ERC-1A; RTP, NC 27711
--- src/exec/dxmods/ORIG/genimp_parse.c Wed Dec 22 13:26:06 1999
+++ src/exec/dxmods/genimp_parse.c      Wed Aug 23 19:02:08 2000
@@ -2333,7 +2333,7 @@
       line = (char *)DXReAllocate(line,(unsigned int)strlen(str)+n*MAX_DSTR);
       strcat(line,str);
    }
-   if (line[strlen(line)-2] == '\r') 
+   if ( strlen(line) >= 2 && line[strlen(line)-2] == '\r') 
      line[strlen(line)-2] = '\n';
    current = line;
    ps->current = current;
--- src/exec/dxmods/ORIG/genimp.c       Mon May 10 11:45:25 1999
+++ src/exec/dxmods/genimp.c    Wed Aug 23 18:54:45 2000
@@ -86,16 +86,16 @@
   if(!(gr = import_Group(&datafp)))
     goto error;
 
-  genimpcleanup();
   if (datafp)
     _dxfclose_dxfile(datafp,_dxd_gi_filename);
+  genimpcleanup();
 
   return gr;
   
  error:
-  genimpcleanup();
   if (datafp)
     _dxfclose_dxfile(datafp,_dxd_gi_filename);
+  genimpcleanup();
 
   if ( DXGetError() == ERROR_NONE )
     {

Reply via email to