mirror of
https://github.com/ascii-boxes/boxes.git
synced 2024-12-14 02:40:38 +01:00
a few fixes related to box removal (as expected)
This commit is contained in:
parent
4a01a9254b
commit
c0b7322493
44
src/boxes.c
44
src/boxes.c
@ -3,7 +3,7 @@
|
|||||||
* Date created: March 18, 1999 (Thursday, 15:09h)
|
* Date created: March 18, 1999 (Thursday, 15:09h)
|
||||||
* Author: Thomas Jensen
|
* Author: Thomas Jensen
|
||||||
* tsjensen@stud.informatik.uni-erlangen.de
|
* tsjensen@stud.informatik.uni-erlangen.de
|
||||||
* Version: $Id: boxes.c,v 1.9 1999/04/09 13:33:24 tsjensen Exp tsjensen $
|
* Version: $Id: boxes.c,v 1.10 1999/06/03 18:54:05 tsjensen Exp tsjensen $
|
||||||
* Language: ANSI C
|
* Language: ANSI C
|
||||||
* Platforms: sunos5/sparc, for now
|
* Platforms: sunos5/sparc, for now
|
||||||
* World Wide Web: http://home.pages.de/~jensen/boxes/
|
* World Wide Web: http://home.pages.de/~jensen/boxes/
|
||||||
@ -18,6 +18,10 @@
|
|||||||
* Revision History:
|
* Revision History:
|
||||||
*
|
*
|
||||||
* $Log: boxes.c,v $
|
* $Log: boxes.c,v $
|
||||||
|
* Revision 1.10 1999/06/03 18:54:05 tsjensen
|
||||||
|
* lots of fixes
|
||||||
|
* Added remove box functionality, which remains to be tested
|
||||||
|
*
|
||||||
* Revision 1.9 1999/04/09 13:33:24 tsjensen
|
* Revision 1.9 1999/04/09 13:33:24 tsjensen
|
||||||
* Removed code related to OFFSET blocks (obsolete)
|
* Removed code related to OFFSET blocks (obsolete)
|
||||||
*
|
*
|
||||||
@ -79,7 +83,7 @@ extern int optind, opterr, optopt; /* for getopt() */
|
|||||||
|
|
||||||
|
|
||||||
static const char rcsid_boxes_c[] =
|
static const char rcsid_boxes_c[] =
|
||||||
"$Id: boxes.c,v 1.9 1999/04/09 13:33:24 tsjensen Exp tsjensen $";
|
"$Id: boxes.c,v 1.10 1999/06/03 18:54:05 tsjensen Exp tsjensen $";
|
||||||
|
|
||||||
extern FILE *yyin; /* lex input file */
|
extern FILE *yyin; /* lex input file */
|
||||||
|
|
||||||
@ -2399,21 +2403,23 @@ int detect_horiz (const int aside, size_t *hstart, size_t *hend)
|
|||||||
/*
|
/*
|
||||||
* Look for east corner shape
|
* Look for east corner shape
|
||||||
*/
|
*/
|
||||||
cs = opt.design->shape + sides[aside][aside==BTOP?SHAPES_PER_SIDE-1:0];
|
if (wcs) {
|
||||||
ecs_save = ecs;
|
cs = opt.design->shape + sides[aside][aside==BTOP?SHAPES_PER_SIDE-1:0];
|
||||||
ecs = strrstr (p, cs->chars[follow], cs->width, goeast);
|
ecs_save = ecs;
|
||||||
if (ecs) {
|
ecs = strrstr (p, cs->chars[follow], cs->width, goeast);
|
||||||
for (q=ecs+cs->width; *q; ++q) {
|
if (ecs) {
|
||||||
if (*q != ' ' && *q != '\t')
|
for (q=ecs+cs->width; *q; ++q) {
|
||||||
break;
|
if (*q != ' ' && *q != '\t')
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (*q)
|
||||||
|
ecs = NULL;
|
||||||
|
}
|
||||||
|
if (!ecs) {
|
||||||
|
gowest = 1;
|
||||||
|
goeast = 0;
|
||||||
|
ecs = ecs_save;
|
||||||
}
|
}
|
||||||
if (*q)
|
|
||||||
ecs = NULL;
|
|
||||||
}
|
|
||||||
if (!ecs) {
|
|
||||||
gowest = 1;
|
|
||||||
goeast = 0;
|
|
||||||
ecs = ecs_save;
|
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (ecs)
|
if (ecs)
|
||||||
@ -2551,6 +2557,10 @@ int remove_box()
|
|||||||
textend = 0;
|
textend = 0;
|
||||||
boxend = 0;
|
boxend = 0;
|
||||||
detect_horiz (BBOT, &textend, &boxend);
|
detect_horiz (BBOT, &textend, &boxend);
|
||||||
|
if (textend == 0 && boxend == 0) {
|
||||||
|
textend = input.anz_lines;
|
||||||
|
boxend = input.anz_lines;
|
||||||
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf (stderr, "----> Last line of box body (text) is %d, ", textend-1);
|
fprintf (stderr, "----> Last line of box body (text) is %d, ", textend-1);
|
||||||
fprintf (stderr, "last line of box is %d.\n", boxend-1);
|
fprintf (stderr, "last line of box is %d.\n", boxend-1);
|
||||||
@ -2569,7 +2579,7 @@ int remove_box()
|
|||||||
return 1; /* internal error */
|
return 1; /* internal error */
|
||||||
if (m == 0) {
|
if (m == 0) {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf (stderr, "line %d: no side match\n", j);
|
fprintf (stderr, "line %2d: no side match\n", j);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (m > 0) {
|
if (m > 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user