groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Groff-commit] groff ChangeLog src/libs/libdriver/input.cpp


From: Werner LEMBERG
Subject: [Groff-commit] groff ChangeLog src/libs/libdriver/input.cpp
Date: Sun, 09 May 2010 10:58:40 +0000

CVSROOT:        /cvsroot/groff
Module name:    groff
Changes by:     Werner LEMBERG <wl>     10/05/09 10:58:39

Modified files:
        .              : ChangeLog 
        src/libs/libdriver: input.cpp 

Log message:
        Handle ditroff command `Dt' without argument gracefully.
        
        Without this patch, grotty goes into an infinite loop if it tries to
        process
        
          x T utf8
          x res 240 24 40
          x init
          p1
          Dt
        
        * src/libs/libdriver/input.cpp (get_integer_arg): Emit a fatal error
        on a non-integer argument, bringing the code into line with the
        behaviour documented in the header comment.
        (get_possibly_integer_args): Terminate the loop on a non-integer
        argument.
        (next_arg_begin): Return newline or EOF after emitting the
        corresponding error, rather than continuing on to the next line.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/groff/ChangeLog?cvsroot=groff&r1=1.1230&r2=1.1231
http://cvs.savannah.gnu.org/viewcvs/groff/src/libs/libdriver/input.cpp?cvsroot=groff&r1=1.10&r2=1.11

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/groff/groff/ChangeLog,v
retrieving revision 1.1230
retrieving revision 1.1231
diff -u -b -r1.1230 -r1.1231
--- ChangeLog   1 May 2010 05:41:20 -0000       1.1230
+++ ChangeLog   9 May 2010 10:58:39 -0000       1.1231
@@ -1,3 +1,24 @@
+2010-05-09  Colin Watson  <address@hidden>
+
+       Handle ditroff command `Dt' without argument gracefully.
+
+       Without this patch, grotty goes into an infinite loop if it tries to
+       process
+
+         x T utf8
+         x res 240 24 40
+         x init
+         p1
+         Dt
+
+       * src/libs/libdriver/input.cpp (get_integer_arg): Emit a fatal error
+       on a non-integer argument, bringing the code into line with the
+       behaviour documented in the header comment.
+       (get_possibly_integer_args): Terminate the loop on a non-integer
+       argument.
+       (next_arg_begin): Return newline or EOF after emitting the
+       corresponding error, rather than continuing on to the next line.
+
 2010-05-01  Werner LEMBERG  <address@hidden>
 
        * doc/groff.texinfo: Improve documentation of \R escape.

Index: src/libs/libdriver/input.cpp
===================================================================
RCS file: /cvsroot/groff/groff/src/libs/libdriver/input.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- src/libs/libdriver/input.cpp        5 Jan 2009 20:11:01 -0000       1.10
+++ src/libs/libdriver/input.cpp        9 May 2010 10:58:39 -0000       1.11
@@ -3,13 +3,13 @@
 // <groff_src_dir>/src/libs/libdriver/input.cpp
 
 /* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004, 2005,
-                 2006, 2008, 2009
+                 2006, 2008, 2009, 2010
    Free Software Foundation, Inc.
 
    Written by James Clark (address@hidden)
    Major rewrite 2001 by Bernd Warken (address@hidden)
 
-   Last update: 5 Jan 2009
+   Last update: 9 May 2010
 
    This file is part of groff, the GNU roff text processing system.
 
@@ -790,7 +790,7 @@
     c = get_char();
   }
   if (!isdigit((int) c))
-    error("integer argument expected");
+    fatal("integer argument expected");
   while (isdigit((int) c)) {
     buf.append(c);
     c = get_char();
@@ -879,6 +879,7 @@
       break;
     default:
       error("integer argument expected");
+      done = true;
       break;
     }
   }
@@ -946,7 +947,7 @@
     case '\n':
     case EOF:
       error("missing argument");
-      break;
+      return c;
     default:                   // first essential character
       return c;
     }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]