mirror of
https://github.com/ascii-boxes/boxes.git
synced 2025-02-24 21:41:05 +01:00
Added GNU GPL disclaimer
Does not kill leading/trailing blank lines anymore when !opt.killblank Added include config.h
This commit is contained in:
parent
80846a69d1
commit
171a21b198
49
src/remove.c
49
src/remove.c
@ -2,23 +2,40 @@
|
|||||||
* File: remove.c
|
* File: remove.c
|
||||||
* Project Main: boxes.c
|
* Project Main: boxes.c
|
||||||
* Date created: June 23, 1999 (Wednesday, 20:59h)
|
* Date created: June 23, 1999 (Wednesday, 20:59h)
|
||||||
* Author: Thomas Jensen
|
* Author: Copyright (C) 1999 Thomas Jensen
|
||||||
* tsjensen@stud.informatik.uni-erlangen.de
|
* 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
|
* Language: ANSI C
|
||||||
* World Wide Web: http://home.pages.de/~jensen/boxes/
|
* World Wide Web: http://home.pages.de/~jensen/boxes/
|
||||||
* Purpose: Box removal, i.e. the deletion of 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:
|
* Revision History:
|
||||||
*
|
*
|
||||||
* $Log: remove.c,v $
|
* $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
|
* Revision 1.1 1999/06/23 19:14:53 tsjensen
|
||||||
* Initial revision
|
* Initial revision
|
||||||
*
|
*
|
||||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -28,7 +45,7 @@
|
|||||||
#include "remove.h"
|
#include "remove.h"
|
||||||
|
|
||||||
static const char rcsid_remove_c[] =
|
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
|
* Phase 4: Remove box top and body lines from input
|
||||||
*/
|
*/
|
||||||
while (empty_line(input.lines+textstart) && textstart < textend) {
|
if (opt.killblank) {
|
||||||
#ifdef DEBUG
|
while (empty_line (input.lines+textstart) && textstart < textend) {
|
||||||
fprintf (stderr, "Killing leading blank line in box body.\n");
|
#ifdef DEBUG
|
||||||
#endif
|
fprintf (stderr, "Killing leading blank line in box body.\n");
|
||||||
++textstart;
|
#endif
|
||||||
}
|
++textstart;
|
||||||
while (empty_line(input.lines+textend-1) && textend > textstart) {
|
}
|
||||||
#ifdef DEBUG
|
while (empty_line (input.lines+textend-1) && textend > textstart) {
|
||||||
fprintf (stderr, "Killing trailing blank line in box body.\n");
|
#ifdef DEBUG
|
||||||
#endif
|
fprintf (stderr, "Killing trailing blank line in box body.\n");
|
||||||
--textend;
|
#endif
|
||||||
|
--textend;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (textstart > boxstart) {
|
if (textstart > boxstart) {
|
||||||
|
Loading…
Reference in New Issue
Block a user