On Wed, 16 Jun 2004 jsimmons@pentafluge.infradead.org wrote:
Hi,
quoted hunk ↗ jump to hunk
+#ifdef TIOCGWINSZ
+ int size_was_set = 0;
+ int cols, rows;
^^^^^^^^^^^^^^^
These should both be initialized to -1 because...
quoted hunk ↗ jump to hunk
- set_window_size ((int) integer_arg (argv[k]), -1,
- fd, device_name);
+ rows = integer_arg (argv[k]);
+ size_was_set = 1;
[...]
quoted hunk ↗ jump to hunk
- set_window_size (-1, (int) integer_arg (argv[k]),
- fd, device_name);
+ cols = integer_arg (argv[k]);
+ size_was_set = 1;
...here maybe only one of them is set, but...
quoted hunk ↗ jump to hunk
+ if (size_was_set)
+ {
+ set_window_size (rows, cols, fd, device_name);
...here both of them are used. Looking at the body of size_was_set()
and the code that was removed from stty it's clear that -1 means don't
change, while 0 means change to 0.
--
Egmont
-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND