Added GNU GPL disclaimer

Does not kill leading/trailing blank lines anymore when !opt.killblank
Added include config.h
This commit is contained in:
Thomas Jensen 1999-07-20 18:57:16 +00:00
parent 80846a69d1
commit 171a21b198

View File

@ -2,23 +2,40 @@
* File: remove.c
* Project Main: boxes.c
* Date created: June 23, 1999 (Wednesday, 20:59h)
* Author: Thomas Jensen
* Author: Copyright (C) 1999 Thomas Jensen
* tsjensen@stud.informatik.uni-erlangen.de
* Version: $Id: remove.c,v 1.1 1999/06/23 19:14:53 tsjensen Exp tsjensen $
* Version: $Id: remove.c,v 1.2 1999/06/25 18:45:33 tsjensen Exp tsjensen $
* Language: ANSI C
* World Wide Web: http://home.pages.de/~jensen/boxes/
* Purpose: Box removal, i.e. the deletion of boxes
* Remarks: ---
*
* Remarks: o 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 of
* the License, or (at your option) any later version.
* o This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* o 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
*
* Revision History:
*
* $Log: remove.c,v $
* Revision 1.2 1999/06/25 18:45:33 tsjensen
* Added initialization of mmok to please compiler
* Changed parameters of empty_side() calls to comply with new signature
*
* Revision 1.1 1999/06/23 19:14:53 tsjensen
* Initial revision
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@ -28,7 +45,7 @@
#include "remove.h"
static const char rcsid_remove_c[] =
"$Id: remove.c,v 1.1 1999/06/23 19:14:53 tsjensen Exp tsjensen $";
"$Id: remove.c,v 1.2 1999/06/25 18:45:33 tsjensen Exp tsjensen $";
@ -891,17 +908,19 @@ int remove_box()
/*
* Phase 4: Remove box top and body lines from input
*/
while (empty_line(input.lines+textstart) && textstart < textend) {
#ifdef DEBUG
fprintf (stderr, "Killing leading blank line in box body.\n");
#endif
++textstart;
}
while (empty_line(input.lines+textend-1) && textend > textstart) {
#ifdef DEBUG
fprintf (stderr, "Killing trailing blank line in box body.\n");
#endif
--textend;
if (opt.killblank) {
while (empty_line (input.lines+textstart) && textstart < textend) {
#ifdef DEBUG
fprintf (stderr, "Killing leading blank line in box body.\n");
#endif
++textstart;
}
while (empty_line (input.lines+textend-1) && textend > textstart) {
#ifdef DEBUG
fprintf (stderr, "Killing trailing blank line in box body.\n");
#endif
--textend;
}
}
if (textstart > boxstart) {