[gs-cvs] rev 7729 - trunk/gs/src

ray at ghostscript.com ray at ghostscript.com
Wed Feb 21 12:24:45 PST 2007


Author: ray
Date: 2007-02-21 12:24:45 -0800 (Wed, 21 Feb 2007)
New Revision: 7729

Modified:
   trunk/gs/src/zcontrol.c
Log:
Fix regression on 124-01.ps. Emulate bizarre Adobe behavior so that the
procedure operand of a 'for' is not executed when BOTH the initial value
and the increment are 0 (or 0.0). Seen with CET 28-07 and FTS 124-01
and verified with custom test file against CPSI.

EXPETECTED DIFFERENCES:

None (this time).


Modified: trunk/gs/src/zcontrol.c
===================================================================
--- trunk/gs/src/zcontrol.c	2007-02-21 15:02:42 UTC (rev 7728)
+++ trunk/gs/src/zcontrol.c	2007-02-21 20:24:45 UTC (rev 7729)
@@ -303,10 +303,16 @@
 {
     os_ptr op = osp;
     register es_ptr ep;
+    int code;
+    float params[3];
 
-    if ( (r_has_type(op - 2, t_integer) && op[-2].value.intval == 0) ||
-         (r_has_type(op - 2, t_real) && op[-2].value.realval == 0.0) ) {
-	pop(4);		/* ignore for with 0 increment CET 28-05 */
+ 	/* Mostly undocumented, and somewhat bizarre Adobe behavior discovered	*/
+	/* with the CET (28-05) and FTS (124-01) is that the proc is not run	*/
+	/* if BOTH the initial value and increment are zero.			*/
+    if ((code = float_params(op - 1, 3, params)) < 0)
+	return code;
+    if ( params[0] == 0.0 && params[1] == 0.0 ) {
+	pop(4);		/* don't run the proc */
 	return 0;
     }
     check_estack(7);
@@ -335,11 +341,6 @@
 	else
 	    make_op_estack(ep, for_neg_int_continue);
     } else {
-	float params[3];
-	int code;
-
-	if ((code = float_params(op - 1, 3, params)) < 0)
-	    return code;
 	make_real(ep - 4, params[0]);
 	make_real(ep - 3, params[1]);
 	make_real(ep - 2, params[2]);



More information about the gs-cvs mailing list