mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 19:26:32 +00:00
Patch by Michael Fritscher
Fix /p when screen buffer is larger than output window svn path=/trunk/; revision=7894
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $Id: dir.c,v 1.7 2004/01/16 19:58:47 weiden Exp $
|
||||
/* $Id: dir.c,v 1.8 2004/01/28 17:47:27 gvg Exp $
|
||||
*
|
||||
* DIR.C - dir internal command.
|
||||
*
|
||||
@@ -113,6 +113,9 @@
|
||||
*
|
||||
* 23-Feb-2001 (Carl Nettelblad <[email protected]>)
|
||||
* dir /s now works in deeper trees
|
||||
*
|
||||
* 28-Jan-2004 (Michael Fritscher <[email protected]>)
|
||||
* Fix for /p, so it is working under Windows in GUI-mode, too.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@@ -496,12 +499,23 @@ DirParsePathspec (LPTSTR szPathspec, LPTSTR szPath, LPTSTR szFilespec)
|
||||
static BOOL
|
||||
IncLine (LPINT pLine, DWORD dwFlags)
|
||||
{
|
||||
BOOL error;
|
||||
CONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo;
|
||||
LONG WindowHeight;
|
||||
error = GetConsoleScreenBufferInfo(hConsole, &lpConsoleScreenBufferInfo);
|
||||
|
||||
WindowHeight= lpConsoleScreenBufferInfo.srWindow.Bottom - lpConsoleScreenBufferInfo.srWindow.Top;
|
||||
|
||||
if (!WindowHeight) //That prevents bad behave if WindowHeight couln't calc
|
||||
{
|
||||
WindowHeight= 1000000;
|
||||
}
|
||||
if (!(dwFlags & DIR_PAGE))
|
||||
return FALSE;
|
||||
|
||||
(*pLine)++;
|
||||
|
||||
if (*pLine >= (int)maxy - 2)
|
||||
if (*pLine >= (int)maxy - 2 || *pLine >= WindowHeight) //Because I don't know if WindowsHeight work under all cases, perhaps then maxy is the right value
|
||||
{
|
||||
*pLine = 0;
|
||||
return (PagePrompt () == PROMPT_BREAK);
|
||||
|
||||
Reference in New Issue
Block a user