This is an autogenerated patch header for a single-debian-patch file. The
delta against upstream is either kept as a single patch, or maintained
in some VCS, and exported as a single patch instead of more manageable
atomic patches.

--- ucblogo-6.2.1.orig/graphics.c
+++ ucblogo-6.2.1/graphics.c
@@ -1097,10 +1097,14 @@ NODE *lsetpencolor(NODE *arg) {
 	if (is_list(car(arg))) {
 	    val = make_intnode(PEN_COLOR_OFFSET);
 	    lsetpalette(cons(val,arg));
-	} else
+	} else {
 	    val = pos_int_arg(arg);
-	set_pen_color(getint(val));
-	save_color();
+	}
+
+	if (NOT_THROWING) {
+	    set_pen_color(getint(val));
+	    save_color();
+	}
 	done_drawing;
     }
     return(UNBOUND);
@@ -1119,9 +1123,13 @@ NODE *lsetbackground(NODE *arg) {
 	if (is_list(car(arg))) {
 	    val = make_intnode(BACKGROUND_COLOR_OFFSET);
 	    lsetpalette(cons(val,arg));
-	} else
+	} else {
 	    val = pos_int_arg(arg);
-	set_back_ground(getint(val));
+	}
+
+	if (NOT_THROWING) {
+	    set_back_ground(getint(val));
+	}
 	done_drawing;
     }
     return(UNBOUND);
@@ -1483,7 +1491,7 @@ NODE *lfilled(NODE *args) {
     } else
 	val = pos_int_arg(args);
     done_drawing;
-    color = getint(val);
+    color = getint(val) % NUMCOLORS;
 
     old_refresh = refresh_p;
     refresh_p = 1;  /* have to save polygon to fill it */
--- ucblogo-6.2.1.orig/wxTurtleGraphics.h
+++ ucblogo-6.2.1/wxTurtleGraphics.h
@@ -24,7 +24,7 @@ struct line {
 	short int x2;
 	short int y2;
 	short int pw;
-	unsigned char color;
+	short int color;
 	unsigned char pm;
 	int vis;
 };
