From 194fd2f78cfd4bb86b16e63f9d6fe6c5c1e08be1 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 24 May 2015 10:27:03 -0400 Subject: [PATCH] merge two sets of patches to makedefs.c,qtext.h Changes to be committed: modified: include/qtext.h modified: util/makedefs.c --- include/qtext.h | 1 + util/makedefs.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/include/qtext.h b/include/qtext.h index ccfbb1407..ac65fc6b3 100644 --- a/include/qtext.h +++ b/include/qtext.h @@ -49,6 +49,7 @@ struct qthdr { #define TEXT_TRUNC "Text record truncated at line %d\n" #define OUT_OF_HEADERS "Too many message types (line %d)\nAdjust N_HDR in qtext.h and recompile.\n" #define OUT_OF_MESSAGES "Too many messages in class (line %d)\nAdjust N_MSG in qtext.h and recompile.\n" +#define QLINE_TOO_LONG "Line %d too long; truncated\n" #else /***** !MAKEDEFS *****/ diff --git a/util/makedefs.c b/util/makedefs.c index 92ee31db9..773b87ac0 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -2423,6 +2423,14 @@ do_questtxt() SpinCursor(3); qt_line++; + if (!index(in_line, '\n')) { + /* no newline; line is longer than QTEXT_IN_SIZ-1 */ + int c; + + Fprintf(stderr, QLINE_TOO_LONG, qt_line); + /* discard the rest of the current input line */ + do { c = fgetc(ifp); } while (c != '\n' && c != EOF); + } if (qt_control(line)) do_qt_control(line); else if (qt_comment(line)) -- 2.50.1