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

Bad interaction between sed and a2ps breaks apsfilter

I thought it could be informative to forward this email to the debian-release list, in case any NMUs may be needed. See http://bugs.debian.org/258042 for the background...

---------- Forwarded message ----------
Date: Fri, 13 Aug 2004 14:19:52 -0400 (EDT)
From: Kevin B. McCarty <kmccarty@Princeton.EDU>
To: schizo@debian.org, mhatta@debian.org
Cc: 258042@bugs.debian.org
Subject: Is this bug the fault of sed or psset? Please reply quickly.


The first attachment to this email, psset.sed, is a sed script is created on-the-fly by psset (in the a2ps package). As you see, lines 5 and 17 of the script begin with the characters "\countdictstack" (without quotes). However, versions 4.1-1 and higher of sed treat the "\co" as an escape sequence representing Ctrl+O (ASCII 15), which breaks the output of psset, and in turn causes Bug# 258042 that is currently filed against gs. Versions 4.0.9-5 and earlier of sed do not do anything special with the "\co".

Now, the Info sed manual describes the "\cX" escape sequence, but I am not intimately familiar with sed so I don't know under what circumstances the escape is substituted in. If the escape should NOT be substituted in, this is a bug in sed that should be fixed. On the other hand, if current versions of sed are behaving correctly, I will reassign it to a2ps.

The second attachment to this email, a2ps.patch, is a trivial patch to fix psset to work with the current behavior of sed. (The patch is harmless if the sed behavior is reverted.) I think it should be applied in any case, since sed is in Base and therefore already frozen, while a2ps is not yet.

Please look after this quickly, because this problem makes apsfilter essentially unusable as a print filter in sarge.

thanks and regards,

Kevin B. McCarty <kmccarty@princeton.edu>   Physics Department
WWW: http://www.princeton.edu/~kmccarty/    Princeton University
GPG: public key ID 4F83C751                 Princeton, NJ 08544
\% Pagedevice definitions:\
\% Push our own mark, since there can be several PS marks pushed depending\
\% where the failure really occured.\
\%%BeginFeature: *Duplex false\
\  (<<) cvx exec /Duplex (false) cvx exec (>>) cvx exec\
\  systemdict /setpagedevice get exec\
\} stopped\
\% My cleartomark\
\{ /psset_mark eq { exit } if } loop\
\countdictstack exch sub dup 0 gt\
\  { end } repeat\
\  pop\
\} ifelse
  b end
b start
b end
diff -ur a2ps-4.13b.old/contrib/psset.in a2ps-4.13b/contrib/psset.in
--- a2ps-4.13b.old/contrib/psset.in	Sun Oct 24 08:41:46 1999
+++ a2ps-4.13b/contrib/psset.in	Fri Aug 13 14:12:56 2004
@@ -221,7 +221,7 @@
 pspagedevice="% Pagedevice definitions:
+  countdictstack
 % Push our own mark, since there can be several PS marks pushed depending
 % where the failure really occured.
@@ -229,7 +229,7 @@
 } stopped
 % My cleartomark
 { /psset_mark eq { exit } if } loop
-countdictstack exch sub dup 0 gt
+  countdictstack exch sub dup 0 gt
   { end } repeat

Reply to: