Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 126403 - a2ps: psset duplex corrupts postscript with ^Ountdictstack instead of countdictstack
Summary: a2ps: psset duplex corrupts postscript with ^Ountdictstack instead of countdi...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Printing (show other bugs)
Hardware: All Other
: High normal (vote)
Assignee: Printing Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-16 03:43 UTC by Phil Pennock
Modified: 2006-06-01 16:31 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Phil Pennock 2006-03-16 03:43:07 UTC
app-text/a2ps ships psset (shell script); psset -d (to set duplex) creates corrupt postscript.
See also: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=163780
which notes that it only happens with some versions of sed installed; (I'd comment there but don't want Yet Another Bugzilla Logon).

It's caused by an attempt (using sed) to escape leading whitespace in a postscript fragment for insertion by a sed filter; it actually inserts a backslash at the start of every line.  It's this which causes the final sed filter invocation to see \countdictstack, \c for control, control-O, resulting in ^Ountdictstack.

Fix is to only escape a leading space with a backslash, instead of inserting a backslash at the start of every line.

--- t   2006-03-16 12:30:48.000000000 +0100
+++ /usr/bin/psset      2006-03-16 12:28:14.000000000 +0100
@@ -241,7 +241,7 @@
 # spaces with a `\' too...
 pspagedevicelen=`echo "$pspagedevice" | wc -l`
 pspagedevice=`echo "$pspagedevice" | \
- sed -e "$pspagedevicelen!s/\$/\\\\\\/;s/^/\\\\\\/"`
+ sed -e "$pspagedevicelen!s/\$/\\\\\\/;s/^ /\\\\\\/"`
 
 case $at in
   0) # Insert last in the Setup, so that we win over other requests.
Comment 1 Stefan Schweizer (RETIRED) gentoo-dev 2006-06-01 16:31:42 UTC
thanks, I added your patch to a2ps-4.13c-r5.ebuild