This is a patch to let more use the window size instead of the buffer size. I'm planning to do some more work on the cmd utils, should I integrate some of them in cmd.exe (as in 4nt) or leave them as separate programs.
Timothy
Index: more.c =================================================================== RCS file: /CVS/ReactOS/rosapps/cmdutils/more.c,v retrieving revision 1.5 diff -u -p -r1.5 more.c --- more.c 24 Feb 2003 23:16:13 -0000 1.5 +++ more.c 20 Oct 2003 09:36:52 -0000 @@ -5,6 +5,8 @@ * * 26 Sep 1999 - Paolo Pantaleo paolopan@freemail.it * started + * Oct 2003 - Timothy Schepens <tischepe at fastmail dot fm> + * use window size instead of buffer size. */
#include <windows.h> @@ -29,11 +31,9 @@ GetScreenSize (PSHORT maxx, PSHORT maxy) CONSOLE_SCREEN_BUFFER_INFO csbi;
GetConsoleScreenBufferInfo (hStdOut, &csbi); + *maxx = csbi.srWindow.Right; + *maxy = csbi.srWindow.Bottom;
- if (maxx) - *maxx = csbi.dwSize.X; - if (maxy) - *maxy = csbi.dwSize.Y; }
@@ -126,7 +126,7 @@ int main (int argc, char **argv) { ch_count=0; line_count++; - if (line_count == maxy-1) + if (line_count == maxy) { line_count = 0; WriteFile(hStdOut,&buff[last], i-last+1, &dwWritten, NULL);
On Mon, 2003-10-20 at 04:43, Timothy Schepens wrote:
This is a patch to let more use the window size instead of the buffer size. I'm planning to do some more work on the cmd utils, should I integrate some of them in cmd.exe (as in 4nt) or leave them as separate programs.
I have committed this patch. Thanks.
As for your question, i personally prefer external commands, but when in doubt, duplicate the behavior in the win2k shell, unless others have opinions on this.
-Vizzini
--- Vizzini vizzini@plasmic.com wrote:
As for your question, i personally prefer external commands, but when in doubt, duplicate the behavior in the win2k shell, unless others have opinions on this.
Comming from the Unix world I agree with you Viz but if we are ever going to have a thin ReactOS I want to have as many commands as possible in cmd.exe.
Think of cmd.exe as ash in Linux, small but very effective.
Thanks Steven
__________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com