bug-groff
[Top][All Lists]
Advanced

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

Re: pic inconsistently diagnoses carriage returns


From: Werner LEMBERG
Subject: Re: pic inconsistently diagnoses carriage returns
Date: Wed, 08 Feb 2012 20:03:05 +0100 (CET)

> pic 1.21 is inconsistent about detecting carriage-return
> characters.  [...]

Thanks for the report.  I've `fixed' (more or less) by adding one more
check for invalid characters.  Your input file `pstest'

  .PS
  define f { $1 }
  .PE
  .PS 2i
  a = f(0)
  .PE

with CRLF line terminations, processed with

  pic pstest > /dev/null

now shows

  pic:pstest:1: invalid input character code 13
  pic:pstest:2: invalid input character code 13
  pic:pstest:3: invalid input character code 13
  pic:pstest:4: nested .PS
  pic:pstest:5: invalid input character code 13
  pic:pstest:6: invalid input character code 13

> Things get really mysterious if the first .PS...PE is in a separate
> file, with CRLF terminations, that is included via .PS <source in a
> second file with LF terminations.  Then the only diagnostic is
> "there is no variable 'f'".  (In fact this scenario is what brought
> the problem to my attention.)

Assuming the file names `pstest.dos' and `pstest.unix' for your test,
pic now reports this on stderr:

  pic:pstest.dos:1: invalid input character code 13
  pic:pstest.dos:2: invalid input character code 13
  pic:pstest.dos:3: invalid input character code 13
  pic:pstest.dos:4: end of file before .PE or .PF
  pic:pstest.dos:1: .PS was here


    Werner



reply via email to

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