]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tinfo/comp_scan.c
ncurses 5.8 - patch 20110307
[ncurses.git] / ncurses / tinfo / comp_scan.c
index bfbb0e25e9f50c6040be9a622ad7c43d08772007..8725b2edb7ebcd73a974d0c452f55a20077dcc56 100644 (file)
@@ -50,7 +50,7 @@
 #include <ctype.h>
 #include <tic.h>
 
-MODULE_ID("$Id: comp_scan.c,v 1.87 2010/05/01 19:56:35 tom Exp $")
+MODULE_ID("$Id: comp_scan.c,v 1.89 2010/12/25 23:06:37 tom Exp $")
 
 /*
  * Maximum length of string capability we'll accept before raising an error.
@@ -203,6 +203,10 @@ next_char(void)
                if (fgets(result + used, (int) (allocated - used), yyin) != 0) {
                    bufstart = result;
                    if (used == 0) {
+                       if (_nc_curr_line == 0
+                           && IS_TIC_MAGIC(result)) {
+                           _nc_err_abort("This is a compiled terminal description, not a source");
+                       }
                        _nc_curr_line++;
                        _nc_curr_col = 0;
                    }
@@ -608,7 +612,7 @@ _nc_get_token(bool silent)
                        _nc_warning("Missing separator");
                }
                _nc_curr_token.tk_name = tok_buf;
-               _nc_curr_token.tk_valnumber = number;
+               _nc_curr_token.tk_valnumber = (int) number;
                type = NUMBER;
                break;