diff options
-rw-r--r-- | generic/tkCanvPs.c | 2 | ||||
-rw-r--r-- | tests/canvPs.test | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/generic/tkCanvPs.c b/generic/tkCanvPs.c index 386ada9..444d6ff 100644 --- a/generic/tkCanvPs.c +++ b/generic/tkCanvPs.c @@ -572,7 +572,6 @@ TkCanvPostscriptCmd( continue; } - Tcl_ResetResult(interp); result = itemPtr->typePtr->postscriptProc(interp, (Tk_Canvas) canvasPtr, itemPtr, 0); if (result != TCL_OK) { @@ -585,6 +584,7 @@ TkCanvPostscriptCmd( Tcl_AppendToObj(psObj, "gsave\n", -1); Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp)); Tcl_AppendToObj(psObj, "grestore\n", -1); + Tcl_ResetResult(interp); if (psInfo.chan != NULL) { if (Tcl_WriteObj(psInfo.chan, psObj) == TCL_IO_FAILURE) { diff --git a/tests/canvPs.test b/tests/canvPs.test index 5e8a4e5..eb09af9 100644 --- a/tests/canvPs.test +++ b/tests/canvPs.test @@ -23,8 +23,8 @@ test canvPs-1.1 {test writing to a file} -constraints { } -setup { set foo [makeFile {} foo.ps] } -body { - .c postscript -file $foo - file exists $foo + set res [.c postscript -file $foo] + lappend res [file exists $foo] } -cleanup { removeFile foo.ps } -result 1 @@ -55,9 +55,9 @@ test canvPs-2.1 {test writing to a channel} -constraints { } -body { set chan [open $foo w] fconfigure $chan -translation lf - .c postscript -channel $chan + set res [.c postscript -channel $chan] close $chan - file exists $foo + lappend res [file exists $foo] } -cleanup { removeFile foo.ps } -result 1 |