Bug 89300 - ps2epsi broken (sed error)
Summary: ps2epsi broken (sed error)
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: ghostscript (Show other bugs)
(Show other bugs)
Version: 9
Hardware: All Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Mike McLean
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-04-22 13:42 UTC by Neal D. Becker
Modified: 2007-04-18 16:53 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-02-18 10:56:32 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Neal D. Becker 2003-04-22 13:42:40 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.1; Linux)

Description of problem:
running ps2epsi gives an error from sed

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. ps2epsi <in> <out>
2.
3.
    

Additional info:

Comment 1 Bryan O'Sullivan 2003-04-22 22:16:39 UTC
Here's the actual error message, since the original reporter didn't bother to
include it:

  sed: -e expression #1, char 42: Invalid range end

The ps2epsi script hasn't changed since RH8; it's the upgrade of sed that seems
to have caused this problem.

The actual trouble is with this expression:

sed -e '/^%%BeginPreview:/,/^%%EndPreview[^!-~]*$/d'

This can be simplified down to the following, without the error message changing:

sed -e '/[^!-~]/d'

What causes the headache is the range spec in square brackets.  The sed packaged
with RH8 accepts this fine, and the version in RH9 pukes.  This appears to be
due to a broken regexp parser in sed.  The following string works fine:

sed -e '/[^!-\~]/d'

The fix to ps2epsi is to escape the tilde character in the script.  Don't know
what to do with sed, or indeed if it's really a bug (the lack of documentation
for ~ suggests that it is, though).

Comment 2 Tim Waugh 2003-04-24 13:46:01 UTC
Jakub, what do you think?

Comment 4 Jakub Jelinek 2003-05-27 16:05:01 UTC
This is ps2epsi bug.
In LC_COLLATE=en_US{,.UTF-8} and a bunch of other locales ~ comes before !
when sorting, so you really cannot write !-~ but ~-! in those locales.
I'd guess that is certainly not what you want, since such range will not include
e.g. letters, digits, etc.
So, I'd suggest LC_ALL=C sed -e '/^%%BeginPreview:/,/^%%EndPreview[^!-~]*$/d'

Comment 5 Tim Waugh 2003-05-27 17:34:49 UTC
Fixed in RH CVS.


Note You need to log in before you can comment on or make changes to this bug.