1
0
mirror of git://projects.qi-hardware.com/openwrt-packages.git synced 2024-11-22 00:44:03 +02:00

gtypist: ignore line too long

This commit is contained in:
Xiangfu 2012-03-11 10:37:38 +08:00
parent 20b0b779c2
commit d52629c803
2 changed files with 49 additions and 1 deletions

View File

@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=gtypist
PKG_VERSION:=2.8.5
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://ftp.gnu.org/gnu/gtypist/
PKG_BUILD_DIR:=$(BUILD_DIR)/gtypist-$(PKG_VERSION)

View File

@ -0,0 +1,48 @@
diff --git a/src/gtypist.c b/src/gtypist.c
index 03e949c..cfa50a8 100644
--- a/src/gtypist.c
+++ b/src/gtypist.c
@@ -564,8 +564,6 @@ do_tutorial( FILE *script, char *line ) {
/* output this line, and each continuation line read */
do
{
- if ( linenum >= LINES - 1 )
- fatal_error( _("data exceeds screen length"), line );
move( linenum, 0 );
ADDSTR( SCR_DATA( line ));
get_script_line( script, line );
@@ -663,8 +661,6 @@ do_drill( FILE *script, char *line ) {
against the screen length */
for ( p = data, lines_count = 0; *p != ASCII_NULL; p++ )
if ( *p == ASCII_NL) lines_count++;
- if ( DP_TOP_LINE + lines_count * 2 > LINES )
- fatal_error( _("data exceeds screen length"), line );
/* if the last command was a tutorial, ensure we have
the complete screen */
@@ -931,8 +927,6 @@ do_speedtest( FILE *script, char *line ) {
against the screen length */
for ( p = data, lines_count = 0; *p != ASCII_NULL; p++ )
if ( *p == ASCII_NL) lines_count++;
- if ( DP_TOP_LINE + lines_count > LINES )
- fatal_error( _("data exceeds screen length"), line );
/* if the last command was a tutorial, ensure we have
the complete screen */
diff --git a/src/script.c b/src/script.c
index 7974a9d..7ca1b3a 100644
--- a/src/script.c
+++ b/src/script.c
@@ -109,12 +109,6 @@ void get_script_line( FILE *script, char *line )
fatal_error( _("data shortage"), line );
if ( SCR_SEP( line ) != C_SEP )
fatal_error( _("missing ':'"), line );
- if ( SCR_COMMAND( line ) != C_LABEL
- && SCR_COMMAND( line ) != C_GOTO
- && SCR_COMMAND( line ) != C_YGOTO
- && SCR_COMMAND( line ) != C_NGOTO
- && strlen( SCR_DATA( line )) > COLS )
- fatal_error( _("line too long for screen"), line );
}
}