If the builtin help won't fit on-screen, and it can't be shortened, don't print it

darcs-hash:20061025203225-ac50b-8675f297a8aabea080edf7946d6f136296a6d7bb.gz
This commit is contained in:
axel
2006-10-26 06:32:25 +10:00
parent dfa73c7cc1
commit 3b0ed061cd

View File

@@ -225,6 +225,7 @@ static void builtin_print_help( wchar_t *cmd, string_buffer_t *b )
if( lines > 2*screen_height/3 )
{
wchar_t *pos;
int cut=0;
/* Find first empty line */
for( pos=str; *pos; pos++ )
@@ -248,9 +249,16 @@ static void builtin_print_help( wchar_t *cmd, string_buffer_t *b )
if( is_empty )
{
*(pos+1)=L'\0';
cut = 1;
break;
}
}
}
if( !cut )
{
*str = 0;
}
}
}