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 ); /* ---------- */