<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>126403</bug_id>
          
          <creation_ts>2006-03-16 03:43 0000</creation_ts>
          <short_desc>a2ps: psset duplex corrupts postscript with ^Ountdictstack instead of countdictstack</short_desc>
          <delta_ts>2006-06-01 16:31:42 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Printing</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>gentoo@spodhuis.org</reporter>
          <assigned_to>printing@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>gentoo@spodhuis.org</who>
            <bug_when>2006-03-16 03:43:07 0000</bug_when>
            <thetext>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&apos;d comment there but don&apos;t want Yet Another Bugzilla Logon).

It&apos;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&apos;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 `\&apos; too...
 pspagedevicelen=`echo &quot;$pspagedevice&quot; | wc -l`
 pspagedevice=`echo &quot;$pspagedevice&quot; | \
- sed -e &quot;$pspagedevicelen!s/\$/\\\\\\/;s/^/\\\\\\/&quot;`
+ sed -e &quot;$pspagedevicelen!s/\$/\\\\\\/;s/^ /\\\\\\/&quot;`
 
 case $at in
   0) # Insert last in the Setup, so that we win over other requests.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>genstef@gentoo.org</who>
            <bug_when>2006-06-01 16:31:42 0000</bug_when>
            <thetext>thanks, I added your patch to a2ps-4.13c-r5.ebuild</thetext>
          </long_desc>
      
    </bug>

</bugzilla>