From 3b938cc30a4c85027a60b6399539722b9ee61c9a Mon Sep 17 00:00:00 2001 From: Philip Hazel Date: Tue, 8 Jun 2010 14:25:58 +0000 Subject: Imported from /Users/nigel/Work/x/xfpt-0.08.tar.bz2. --- share/stdmacs | 2 +- src/globals.c | 4 ++-- src/read.c | 13 ++++++++----- testing/outfiles/03 | 3 +-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/share/stdmacs b/share/stdmacs index 967c0c206..ce22a05cd 100644 --- a/share/stdmacs +++ b/share/stdmacs @@ -422,7 +422,7 @@ .literal layout &&&& && + $=4+ depth="$4"+$=5+ width="$5"+>&&&& &&&&&& .literal off .endmacro diff --git a/src/globals.c b/src/globals.c index 56d5a28fe..2347150a4 100644 --- a/src/globals.c +++ b/src/globals.c @@ -2,7 +2,7 @@ * xfpt - Simple ASCII->Docbook processor * *************************************************/ -/* Copyright (c) University of Cambridge, 2009 */ +/* Copyright (c) University of Cambridge, 2010 */ /* Written by Philip Hazel. */ /* Allocate storage and initialize global variables */ @@ -11,7 +11,7 @@ uschar *xfpt_share = US DATADIR; -uschar *xfpt_version = US "0.07 22-July-2009"; +uschar *xfpt_version = US "0.08 08-June-2010"; tree_node *entities = NULL; diff --git a/src/read.c b/src/read.c index cd384eeb7..4aa8757fa 100644 --- a/src/read.c +++ b/src/read.c @@ -2,7 +2,7 @@ * xfpt - Simple ASCII->Docbook processor * *************************************************/ -/* Copyright (c) University of Cambridge, 2008 */ +/* Copyright (c) University of Cambridge, 2010 */ /* Written by Philip Hazel. */ /* This module contains code for reading the input. */ @@ -224,7 +224,10 @@ if (popto > 0) } /* Get the next line from the current macro or the current file. We need a loop -for handling the ends of macros and files. */ +for handling the ends of macros and files. First check for having previously +reached the end of the input. */ + +if (from_type_ptr < 0) return NULL; for (;;) { @@ -249,7 +252,6 @@ for (;;) else { - if (istack == NULL) return NULL; if (Ufgets(inbuffer, INBUFFSIZE, istack->file) == NULL) { istackstr *prev = istack->prev; @@ -291,9 +293,10 @@ for (;;) /* We get here if the end of a macro or a file was reached. The appropriate chain has been popped. Back up the stack of input types before the loop - repeats. */ + repeats. When we reach the end of the stack, we have reached the end of all + the input. */ - from_type_ptr--; + if (--from_type_ptr < 0) return NULL; } return inbuffer; diff --git a/testing/outfiles/03 b/testing/outfiles/03 index 0e3290abf..6c7486f46 100644 --- a/testing/outfiles/03 +++ b/testing/outfiles/03 @@ -5,8 +5,7 @@ box "A"; line; circle "B";
- - +
-- cgit v1.2.1