From 15fc6ff3af84ef10594f6dd661be51e76affe6c9 Mon Sep 17 00:00:00 2001 From: Vizzini Date: Thu, 23 Oct 2003 21:36:43 +0000 Subject: [PATCH] more.c: Patch from Timothy Schepens : This is a patch to let more use the window size instead of the buffer size. sort.c: fixed qsort warning svn path=/trunk/; revision=6421 --- rosapps/cmdutils/more.c | 10 +++++----- rosapps/cmdutils/sort.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rosapps/cmdutils/more.c b/rosapps/cmdutils/more.c index 50855c2a3bc..d1bd8c51fd0 100644 --- a/rosapps/cmdutils/more.c +++ b/rosapps/cmdutils/more.c @@ -5,6 +5,8 @@ * * 26 Sep 1999 - Paolo Pantaleo * started + * Oct 2003 - Timothy Schepens + * use window size instead of buffer size. */ #include @@ -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); diff --git a/rosapps/cmdutils/sort.c b/rosapps/cmdutils/sort.c index 98e84c282eb..0d6cc56cb4e 100644 --- a/rosapps/cmdutils/sort.c +++ b/rosapps/cmdutils/sort.c @@ -34,7 +34,7 @@ int sortcol; /* sort column */ int err = 0; /* error counter */ int -cmpr(void *a, void *b) +cmpr(const void *a, const void *b) { char *A, *B;