groff
[Top][All Lists]
Advanced

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

Re: [Groff] Segmentation fault in grops


From: Ted Harding
Subject: Re: [Groff] Segmentation fault in grops
Date: Wed, 02 Feb 2000 23:43:20 -0000 (GMT)

On 02-Feb-00 Werner LEMBERG wrote:
> 
>> I compiled groff 1.15 from source on Linux 2.2.14, ELF, on glibc
>> 2.1.12 with libstdc++-3-libc6.1-2-2.10.0.
>> 
>> I can send the EPS to a developer if interested.
> 
> It depends on the size.  I'm sitting behind a 28.8k modem...
> 
>> 
>> Another thing is that Mac EPS use \r as a newline and psbb doesn't
>> accept this; any fixes?
> 
> psbb no longer exists (in the current snapshot); there is a new .psbb
> request in troff.

Whether it's done by old grops or by new internals, whatever does the
job will have to recognise \r as well since it is one of the
PostScript-valid line terminators ( \r , \n , \r\n  ). The job is to
import a PS object, in whatever form of valid conforming PS it has.

I hadn't been aware of this problem, but it's there for sure
in grops: a simple EPS file with \n terminators was converted to
have \r terminators, and psbb failed to find a BoundingBox line.

I think this needs to be fixed (a) in grops for those who continue
to use that; (b) (if not already fixed) in the new .psbb request
in groff.

Meanwhile, a simple workround which should be good for almost
all cases is

  cat badfile | tr '\r' '\n' > goodfile

which will turn all \r's into \n's, and outside literal
strings multiple \n's are equivalent to a single \n.
Unfortunately this makes the importing of PS less tidy and
convenient. There is also at least one circumstance in which it
could cause problems: if a \r\n pair occurs within a literal
PostScript string as in

  (This is end-of-line\r\nand this is a new line)

(where \r and \n stand for the single-byte control characters),
this would be translated by the above to

  (This is end-of-line\n\nand this is a new line)

which may not be what is wanted: PostScript converts \r and \r\n
within a (...) string to a single \n, except when reading from a
file with 'read' and 'readstring', but \n\n is left as it is.
The result would be that whereas

  (This is some text\r\nand this is more text)

would print as

  This is some text and this is more text

(the \r\n is converted internally to \n and comes out as a space),

  (This is some text\n\nand this is more text)

would print as

  This is some text  and this is more text

(the \n\n would give two spaces).

Hmmm.
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Date: 02-Feb-00                                       Time: 23:43:19
------------------------------ XFMail ------------------------------


reply via email to

[Prev in Thread] Current Thread [Next in Thread]