[comp.windows.x] xfig question; xbrowser question

DEG41560@UA1VM.BITNET (Rob Smith) (01/08/89)

Hi,

 Question 1) The xfig man page speaks of several xfig to * translators,
but it seems only one of them came with the distribution.  Where can one
obtain the others, in particular the fig-to-LaTeX and PiCTeX convertors?

 Question 2) I know the code is not supposed to be ported yet, but has any
one gotten the recently posted xbrowser routine to run under Ultrix?
Mine compiles, and runs, but it dumps the core (Illegal Instruction)
when I hit the List or Parent buttons.  I could really use this program,
but I don't have time to port it. Any fixes?


                                        Thanks,
                                           Rob.

treese@CRL.DEC.COM (Win Treese) (01/12/89)

 
>  Question 2) I know the code is not supposed to be ported yet, but has any
> one gotten the recently posted xbrowser routine to run under Ultrix?
> Mine compiles, and runs, but it dumps the core (Illegal Instruction)
> when I hit the List or Parent buttons.  I could really use this program,
> but I don't have time to port it. Any fixes?
>
>                                        Thanks,
> 					      Rob.
 
Enclosed is a context diff for xbrowser/ap.c that allows it to run under
Ultrix 3.0 (and probably other versions as well).  The problem was that
xbrowser was malloc'ing memory for a structure that it did not fully initialize.
If you happen to get something besides zeros in the other fields, bad things
can happen.
 
I haven't tried everything in the program yet, so other changes may be
necessary.  At least listing files and moving around in the directory
hierarchy works now.
 
Win Treese					Cambridge Research Lab
treese@crl.dec.com				Digital Equipment Corp.
 
*** /tmp/,RCSt1a26218   Wed Jan 11 21:36:45 1989
--- ap.c        Wed Jan 11 21:30:40 1989
***************
*** 3,9
  static char *PROGRAM_information[] =
  {
      "Copyright (c) 1988 Xerox Corporation.  All rights reserved.",
!     "$Header: ap.c,v 1.1 89/01/08 03:02:16 treese Exp $",
      "$Locker:  $"
  }
  ;
 
--- 3,9 -----
  static char *PROGRAM_information[] =
  {
      "Copyright (c) 1988 Xerox Corporation.  All rights reserved.",
!     "$Header: ap.c,v 1.2 89/01/11 21:30:19 treese Exp $",
      "$Locker:  $"
  }
  ;
***************
*** 111,116
    XtTextSource src;
    ApAsSourceData *data;
      src = (XtTextSource) XtMalloc(sizeof(XtTextSourceRec));
      src->Read = ApAsRead;
      src->Replace = ApAsReplace; 
      src->GetLastPos = ApAsGetLastPos;
 
--- 111,117 -----
    XtTextSource src;
    ApAsSourceData *data;
      src = (XtTextSource) XtMalloc(sizeof(XtTextSourceRec));
+     bzero( (char *) src, sizeof(XtTextSourceRec));
      src->Read = ApAsRead;
      src->Replace = ApAsReplace; 
      src->GetLastPos = ApAsGetLastPos;