From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 15-AUG-1990 19:23:46.67
To:	MRGATE::"ARISIA::EVERHART"
CC:	
Subj:	PBMPLUS for VMS: patch to ppmscale 1/1

Received:  by crdgw1.ge.com (5.57/GE 1.70)
	 id AA05008; Wed, 15 Aug 90 18:59:03 EDT
Received: From UCBVAX.BERKELEY.EDU by CRVAX.SRI.COM with TCP; Wed, 15 AUG 90 15:29:36 PDT
Received: by ucbvax.Berkeley.EDU (5.63/1.42)
	id AA01172; Wed, 15 Aug 90 15:11:04 -0700
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-vax@kl.sri.com (info-vax@kl.sri.com)
	(contact usenet@ucbvax.Berkeley.EDU if you have questions)
Date: 15 Aug 90 16:02:29 GMT
From: maverick.ksu.ksu.edu!deimos.cis.ksu.edu!mccall!tp@uunet.uu.net
Organization: The McCall Pattern Co., Manhattan, KS, USA
Subject: PBMPLUS for VMS: patch to ppmscale 1/1
Message-Id: <3397.26c97216@mccall.com>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com

Submitted-by: tp@mccall.com (Terry Poot)
Archive-name: pbmplus/patch1-part1

The following patch is needed for ppmscale to work at all on VMS. This is a
patch to the VMS version. Apply it with Larry Wall's patch utility, NOT the
VMS patch command.

*** ppmscale.c_orig
--- ppmscale.c
**************
*** 57,62
  		pm_error(
  		    "only one of -xsize/-width and -xscale may be specified",
  		    0,0,0,0,0 );
  	    if ( sscanf( argv[argn+1], "%g", &xscale ) != 1 )
  		pm_usage( usage );
  	    if ( xscale <= 0.0 )
--- 57,65 -----
  		pm_error(
  		    "only one of -xsize/-width and -xscale may be specified",
  		    0,0,0,0,0 );
+ #ifdef VMS
+ 	    if ( sscanf( argv[argn+1], "%f", &xscale ) != 1 )
+ #else
  	    if ( sscanf( argv[argn+1], "%g", &xscale ) != 1 )
  #endif
  		pm_usage( usage );
**************
*** 58,63
  		    "only one of -xsize/-width and -xscale may be specified",
  		    0,0,0,0,0 );
  	    if ( sscanf( argv[argn+1], "%g", &xscale ) != 1 )
  		pm_usage( usage );
  	    if ( xscale <= 0.0 )
  		pm_error( "x scale must be greater than 0", 0,0,0,0,0 );
--- 61,67 -----
  	    if ( sscanf( argv[argn+1], "%f", &xscale ) != 1 )
  #else
  	    if ( sscanf( argv[argn+1], "%g", &xscale ) != 1 )
+ #endif
  		pm_usage( usage );
  	    if ( xscale <= 0.0 )
  		pm_error( "x scale must be greater than 0", 0,0,0,0,0 );
**************
*** 69,74
  		pm_error(
  		    "only one of -ysize/-height and -yscale may be specified",
  		    0,0,0,0,0 );
  	    if ( sscanf( argv[argn+1], "%g", &yscale ) != 1 )
  		pm_usage( usage );
  	    if ( yscale <= 0.0 )
--- 73,81 -----
  		pm_error(
  		    "only one of -ysize/-height and -yscale may be specified",
  		    0,0,0,0,0 );
+ #ifdef VMS
+ 	    if ( sscanf( argv[argn+1], "%f", &yscale ) != 1 )
+ #else
  	    if ( sscanf( argv[argn+1], "%g", &yscale ) != 1 )
  #endif
  		pm_usage( usage );
**************
*** 70,75
  		    "only one of -ysize/-height and -yscale may be specified",
  		    0,0,0,0,0 );
  	    if ( sscanf( argv[argn+1], "%g", &yscale ) != 1 )
  		pm_usage( usage );
  	    if ( yscale <= 0.0 )
  		pm_error( "y scale must be greater than 0", 0,0,0,0,0 );
--- 77,83 -----
  	    if ( sscanf( argv[argn+1], "%f", &yscale ) != 1 )
  #else
  	    if ( sscanf( argv[argn+1], "%g", &yscale ) != 1 )
+ #endif
  		pm_usage( usage );
  	    if ( yscale <= 0.0 )
  		pm_error( "y scale must be greater than 0", 0,0,0,0,0 );
**************
*** 111,116
  	/* No flags specified, so a single scale factor is required. */
  	if ( argn == argc )
  	    pm_usage( usage );
  	if ( sscanf( argv[argn], "%g", &xscale ) != 1 )
  	    pm_usage( usage );
  	if ( xscale <= 0.0 )
--- 119,127 -----
  	/* No flags specified, so a single scale factor is required. */
  	if ( argn == argc )
  	    pm_usage( usage );
+ #ifdef VMS
+ 	if ( sscanf( argv[argn], "%f", &xscale ) != 1 )
+ #else
  	if ( sscanf( argv[argn], "%g", &xscale ) != 1 )
  #endif
  	    pm_usage( usage );
**************
*** 112,117
  	if ( argn == argc )
  	    pm_usage( usage );
  	if ( sscanf( argv[argn], "%g", &xscale ) != 1 )
  	    pm_usage( usage );
  	if ( xscale <= 0.0 )
  	    pm_error( "scale must be greater than 0", 0,0,0,0,0 );
--- 123,129 -----
  	if ( sscanf( argv[argn], "%f", &xscale ) != 1 )
  #else
  	if ( sscanf( argv[argn], "%g", &xscale ) != 1 )
+ #endif
  	    pm_usage( usage );
  	if ( xscale <= 0.0 )
  	    pm_error( "scale must be greater than 0", 0,0,0,0,0 );

