Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 89300 - ps2epsi broken (sed error)
ps2epsi broken (sed error)
Product: Red Hat Linux
Classification: Retired
Component: ghostscript (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2003-04-22 09:42 EDT by Neal D. Becker
Modified: 2007-04-18 12:53 EDT (History)
2 users (show)

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

Attachments (Terms of Use)

  None (edit)
Description Neal D. Becker 2003-04-22 09:42:40 EDT
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:

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

Additional info:
Comment 1 Bryan O'Sullivan 2003-04-22 18:16:39 EDT
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 09:46:01 EDT
Jakub, what do you think?
Comment 4 Jakub Jelinek 2003-05-27 12:05:01 EDT
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 13:34:49 EDT
Fixed in RH CVS.

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