diff options
Diffstat (limited to 'Build/source/utils/texinfo/makeinfo/float.c')
-rw-r--r-- | Build/source/utils/texinfo/makeinfo/float.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/Build/source/utils/texinfo/makeinfo/float.c b/Build/source/utils/texinfo/makeinfo/float.c index b2c9a3367c1..8866ffb3fd2 100644 --- a/Build/source/utils/texinfo/makeinfo/float.c +++ b/Build/source/utils/texinfo/makeinfo/float.c @@ -1,12 +1,12 @@ /* float.c -- float environment functions. - $Id: float.c,v 1.8 2004/07/05 22:23:22 karl Exp $ + $Id: float.c,v 1.12 2007/07/01 21:20:32 karl Exp $ - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + along with this program. If not, see <http://www.gnu.org/licenses/>. Originally written by Alper Ersoy <dirt@gtk.org>. */ @@ -219,6 +218,14 @@ cm_listoffloats (void) { if (strlen (temp->id) > 0 && STREQ (float_type, temp->type)) { + char *caption; + if (strlen (temp->shorttitle) > 0) + caption = expansion (temp->shorttitle, 0); + else if (strlen (temp->title) > 0) + caption = expansion (temp->title, 0); + else + caption = ""; + if (html) { /* A bit of space for HTML reabality. */ @@ -242,13 +249,11 @@ cm_listoffloats (void) add_word (temp->number); } - if (strlen (temp->title) > 0) + if (caption) { - if (strlen (float_type) > 0 - || strlen (temp->id) > 0) + if (strlen (float_type) > 0 || strlen (temp->id) > 0) insert_string (": "); - - execute_string ("%s", temp->title); + execute_string ("%s", caption); } add_word ("</a>"); @@ -259,7 +264,6 @@ cm_listoffloats (void) { char *entry; char *raw_entry; - char *title = expansion (temp->title, 0); int len; int aux_chars_len; /* these are asterisk, colon, etc. */ @@ -285,25 +289,19 @@ cm_listoffloats (void) /* Allocate enough space for possible expansion later. */ raw_entry = (char *) xmalloc (strlen (float_type) - + strlen (temp->number) + strlen (title) + + strlen (temp->number) + strlen (caption) + sizeof (": ")); sprintf (raw_entry, "%s %s", float_type, temp->number); - if (strlen (title) > 0) + if (strlen (caption) > 0) strcat (raw_entry, ": "); number_len = strlen (raw_entry); - len = strlen (title) + strlen (raw_entry); - - /* If we have a @shortcaption, try it if @caption is - too long to fit on a line. */ - if (len + aux_chars_len > column_width - && strlen (temp->shorttitle) > 0) - title = expansion (temp->shorttitle, 0); + len = strlen (caption) + strlen (raw_entry); - strcat (raw_entry, title); + strcat (raw_entry, caption); len = strlen (raw_entry); if (len + aux_chars_len > column_width) @@ -324,7 +322,7 @@ cm_listoffloats (void) went as far as the beginning. Just print as much as possible of the title. */ if (len == 0 - || (len == number_len && strlen (title) > 0)) + || (len == number_len && strlen (caption) > 0)) len = column_width - sizeof ("..."); /* Break here. */ @@ -393,8 +391,10 @@ cm_listoffloats (void) insert_string (".\n"); free (entry); - free (title); } + + if (strlen (caption) > 0) + free (caption); } temp = temp->next; } |