[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]

PATCH (0.55 bug): Subroutine args incorrectly propagated to curscr



If you use the

	&function

syntax, with no explicit argument list, Perl propagates the current
contents of @_ to the function as its argument list..

This caused failures in ZigZag 0.55 when I pressed the control-R key.
For some reason, @_ was not empty, and was propagated to the curses
function `curscr', which would die with the message:

	Curses function 'curscr' called with too many arguments at (eval 21) line 1.
	        ...propagated at ./zigzag line 1888.
	        ...propagated at ./zigzag line 1903.

This patch fixes the bug.  I suggest that in the future the & syntax
be avoided.

--- zigzag.55	Tue Oct 27 22:55:17 1998
+++ zigzag	Tue Oct 27 22:55:50 1998
@@ -177,7 +177,7 @@
    "q"                => 'view_quadrant_toggle(1);',
    "R"		      => 'view_reset(0);',
    "r"		      => 'view_reset(1);',
-   "\cR"	      => 'display_refresh(&curscr); $@ = "";',
+   "\cR"	      => 'display_refresh(curscr()); $@ = "";',
    "T"                => 'atcursor_clone(0);',
    "t"                => 'atcursor_clone(1);',
    "V"                => 'view_raster_toggle(0);',


Mark-Jason Dominus 	  			               mjd@xxxxxxxxxx