[l2h] Ghostscript version tweak to config.pl

John Milton John Milton <jmilton@fundsxpress.com>
Thu, 20 Jul 2000 10:59:06 -0500


Ross Moore wrote:
> > FYI,
> >
> > Recent versions of Ghostscript output version info with --help WITHOUT
> > the "Version"
> >
> >
> > Here is a suggested fix:
> >
> > --- config.pl.dist      Wed Jul 12 00:15:01 2000
> > +++ config.pl   Wed Jul 12 16:52:16 2000
> > @@ -983,6 +983,9 @@
> >          if(/Ghostscript\s*(?:Version|BETA RELEASE|TESTER
> > RELEASE)\s*(\d+[.]?\d*)/i) {
> >            $gs_version = $1;
> >          }
> > +        elsif(/Ghostscript\s*(\d+[.]?\d*)/i) {
> > +          $gs_version = $1;
> > +       }
> >          elsif(/^\s*Available devices/i) {
> >            $flag = 1; # Now look for the devices
> >          }
> 
> Thanks John,
> 
> But that isn't the full fix.
> Surely it is sufficient to match the string as follows:
> 
>  if(/Ghostscript\s*(?:Version|BETA RELEASE|TESTER RELEASE|)\s*(\d+[.]?\d*)/i) {
> #               match the empty string this way ---------^^
>         $gs_version = $2;
> #                      ^------ version number is in $2,  not $1
>     }
>     elsif(/^\s*Available devices/i) {
>         $flag = 1; # Now look for the devices
>     }
> 
> Hope this helps,
> 
>         Ross Moore

Not really. The first one works just fine. The "?:" thingy
means to suppress the () = $1 behavior for that set of
parentheses.

My fix was the three added lines with the "+".

Actually, now that I look at it, I could reduce my fix to:

-          if(/Ghostscript\s*(?:Version|BETA RELEASE|TESTER
RELEASE)\s*(\d+[.]?\d*)/i) {
+          if(/Ghostscript\s*(?:Version|BETA RELEASE|TESTER
RELEASE)?\s*(\d+[.]?\d*)/i) {

John
-- 
John Bly Milton IV   (512) w:493-2764, h:873-8567, m:791-8567
FundsXpress  jmilton@fundsxpress.com  Don't FLAME, inform!  O-