Bug 692328 - sed pstopxl.in is using perl regex which is not portable (not standard or posix)
Summary: sed pstopxl.in is using perl regex which is not portable (not standard or po...
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: CUPS driver (show other bugs)
Version: master
Hardware: PC All
: P4 normal
Assignee: Henry Stiles
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-07 10:06 UTC by jirib
Modified: 2011-07-28 01:48 UTC (History)
5 users (show)

See Also:
Customer:
Word Size: ---


Attachments
patch for pstopxl.in (6.29 KB, patch)
2011-07-07 10:06 UTC, jirib
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jirib 2011-07-07 10:06:24 UTC
Created attachment 7649 [details]
patch for pstopxl.in

Hello,

sed pstopxl.in is using perl regex which is not portable (not standard  or posix), this works only with GNU sed but there's not need to be tied with this specific sed implementation (for example BSD people do usually not want to have another sed [GNU] installed; and there's no need usually), all \s or \S could have posix syntax - [[:space:]] or [^[:space:]].

Attached diff is just replacement of all occurrences of \s and \S with [[:space:]] and [^[:space:]].

The filter itself hasn't been tested yet.

jirib
Comment 1 Henry Stiles 2011-07-07 16:04:28 UTC
Hi Till thought you could have a look at this one, but if you don't have time send it back to me.
Comment 2 Hin-Tak Leung 2011-07-27 03:11:59 UTC
(In reply to comment #0)
> Created an attachment (id=7649) [details]
> patch for pstopxl.in

> The filter itself hasn't been tested yet.

That's somewhat wrong.

See also previous discussion in bug 691292 regarding essentially the same issue. The current code is supposed to cover both gnu sed and bsd sed (which covers most of the modern platforms), I think. pure posix sed is rare to find.
Comment 3 jirib 2011-07-27 06:40:43 UTC
detection if using GNU sed or "other" sed is OK, my complain is that you use perl regex style which is not covered in every "other" sed programs. That's it.

So as most "other" sed programs are POSIX compatible I created this diff to replace perl regex (this is probably used only by GNU sed) with different regex style (POSIX) to have it running on every sed which exists.

I don't understand why are you so defending perl regex in sed? :)
Comment 4 Till Kamppeter 2011-07-27 18:54:33 UTC
This bug and a bug for monochrome printing on a color printer are fixed now.

GIT commit 6ab36cb4256fbd9aa00

Will also go into GS 9.04.
Comment 5 Till Kamppeter 2011-07-27 18:55:27 UTC
Closing ...
Comment 6 Hin-Tak Leung 2011-07-28 01:48:58 UTC
(In reply to comment #2)
> > The filter itself hasn't been tested yet.
> 
> That's somewhat wrong.

(In reply to comment #3)
> I don't understand why are you so defending perl regex in sed? :)

I was referring to "hasn't been tested" being somewhat wrong.