From 3a941f4ae2213f26118f5cfde03ca793b31ca838 Mon Sep 17 00:00:00 2001 From: Jonathan McCrohan Date: Tue, 8 May 2012 14:52:05 +0100 Subject: Imported Upstream version 2.2.3 --- figlet.c | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) (limited to 'figlet.c') diff --git a/figlet.c b/figlet.c index d3bfbbb..e26d42b 100644 --- a/figlet.c +++ b/figlet.c @@ -3,16 +3,17 @@ FIGlet Copyright 1991, 1993, 1994 Glenn Chappell and Ian Chai FIGlet Copyright 1996, 1997, 1998, 1999, 2000, 2001 John Cowan FIGlet Copyright 2002 Christiaan Keet + FIGlet Copyright 2011 Claudio Matsuoka Portions written by Paul Burton and Christiaan Keet Internet: FIGlet, along with the various FIGlet fonts and documentation, is - copyrighted under the provisions of the Academic Free License + copyrighted under the provisions of the New BSD License (3-clause) (as listed in the file "LICENSE" which is included in this package) ****************************************************************************/ -#define DATE "05 July 2005" -#define VERSION "2.2.2" -#define VERSION_INT 20202 +#define DATE "12 January 2011" +#define VERSION "2.2.3" +#define VERSION_INT 20203 /* FIGlet (Frank, Ian & Glenn's Letters) */ /* by Glenn Chappell */ @@ -36,6 +37,7 @@ http://www.figlet.org/ */ /* Release 2.2.2 by Christiaan Keet: License changed from "Artistic License" to "Academic Free License" as agreed by FIGlet authors. 05 July 2005 */ +/* Release 2.2.3 by Claudio Matsuoka, 12 January 2011 */ /*--------------------------------------------------------------------------- DEFAULTFONTDIR and DEFAULTFONTFILE should be defined in the Makefile. @@ -62,6 +64,7 @@ #include /* Needed for get_columns */ #ifdef unix +#include #include /* Needed for get_columns */ #endif @@ -655,7 +658,7 @@ char *controlname; inchr firstch,lastch; char dashcheck; inchr offset; - char *controlpath,magicnum[5]; + char *controlpath; int command; ZFILE *controlfile; int namelen; @@ -1423,7 +1426,7 @@ int smushamt() int addchar(c) inchr c; { - int smushamount,row,k; + int smushamount,row,k,column,offset; char *templine; getletter(c); @@ -1433,6 +1436,7 @@ inchr c; return 0; } + offset = 0; templine = (char*)myalloc(sizeof(char)*(outlinelenlimit+1)); for (row=0;row=0;i--) { if (!gotspace && inchrline[i]==' ') { gotspace = 1; @@ -1605,7 +1615,7 @@ inchr c; int Agetchar() { extern int optind; /* current argv[] element under study */ - static AgetMode = 0; /* >= 0 for displacement into argv[n], <0 EOF */ + static int AgetMode = 0; /* >= 0 for displacement into argv[n], <0 EOF */ char *arg; /* pointer to active character */ int c; /* current character */ @@ -1657,12 +1667,12 @@ inchr iso2022() if (ch == 27) ch = Agetchar() + 0x100; /* ESC x */ if (ch == 0x100 + '$') ch = Agetchar() + 0x200; /* ESC $ x */ switch (ch) { - case 14: /* invoke G0 into GL */ - gl = 0; - return iso2022(); - case 15: /* invoke G1 into GL */ + case 14: /* invoke G1 into GL */ gl = 1; return iso2022(); + case 15: /* invoke G0 into GL */ + gl = 0; + return iso2022(); case 142: case 'N' + 0x100: /* invoke G2 into GL for next char */ save_gl = gl; save_gr = gr; gl = gr = 2; @@ -2029,5 +2039,5 @@ char *argv[]; if (outlinelen!=0) { printline(); } - exit(0); + return 0; } -- cgit v1.2.3