MacOS X doesn't define unix or __unix__, so also check for __APPLE__ to
include unistd.h (needed by getopt()).
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
https://github.com/cmatsuoka/figlet/issues/4
lorenzogatti commented on Oct 28, 2014:
Another case of buffer overrun in the same function, again for right to left
layout: smushing away more characters that are contained in the outputline[]
buffers, with STRCAT being passed an invalid pointer (past the end of an
outputline[] buffer).
How is it possible to smush more characters than the length of the buffer? A
single character can be wider than the current line, but smushamt() doesn't
limit the amount of smushing to the length of the current line. Enormous
amounts of smushing are possible with space-rich fonts, such as the Obanner
collection.
Fixed in smushamt() by limiting the range of the result.
Test case:
$ figlet -f obanner132.flf -R -x -o -p -w 77 "Banner, o Banner"
--
Original fix by Lorenzo Gatti, reworked by Claudio Matsuoka.
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Local string buffer was being operated without proper initialization, causing
wcslen() to operate on invalid values.
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
The gcc compiler has unused value warnings enabled by default, so add
-Wno-unused-value flag to reduce noise in the compiler output.
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Add support for unicode character #3232. This character is of note because
it's commonly used to create the "look of disapproval" ASCII Art face: ಠ_ಠ.
You can see a FIGlet look of disapproval here:
_____) _____)
/_ ___/ /_ ___/
/ _ \ / _ \
| (_) | | (_) |
\___/ _____ \___/
|_____|
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Replaced mktemp which can be different/absent in some systems with
static filenames which should be good enough for our tests.
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Hex sequence is not POSIX compliant, causing run-tests.sh to fail on
systems with Debian Almquist shell as the default shell.
Signed-off-by: Jonathan McCrohan <jmccrohan@gmail.com>
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Use printf instead of echo -n in order to have a Single Unix Specification
compliant script and work in MacOS X 10.5.
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Jonathan McCrohan reported missing files in 2.2.3 and 2.2.4 distribution
package, namely figmagic (containing patterns for /etc/magic) and
getopt.c (to add CLI parameter support for non-Unix platforms).
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Based on patch submitted by Kenneth Davies <kshrub@yahoo.com>
submitted in Debian bug #300735. Decrufted to provide double free()
fix, with minimal changes to FIGlet coding styles.
Bug-Debian: http://bugs.debian.org/300735
Signed-off-by: Jonathan McCrohan <jmccrohan@gmail.com>
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Revert JIS0201 map file to the file added by Micah Cowan in commit
6866db6fce7951cc5e82a1dc7cc5e749b08f88e1
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Test banner was being print before setting the fonts directory, which
make it fail if FIGlet is not already installed on the system.
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
As found by Debian lintian checker:
hyphen-used-as-minus-sign
Signed-off-by: Jonathan McCrohan <jmccrohan@gmail.com>
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Jonathan McCrohan of Debian reported that FIGlet still contained non-
distributable files fonts/8859-*.flc which had the following notice:
"Unicode, Inc. specifically excludes the right to re-distribute this
file directly to third parties or other organizations whether for
profit or not".
John Cowan informed that "Those should simply be replaced by the verbatim
contents of the corresponding files at
http://www.unicode.org/Public/MAPPINGS/ISO8859 .
In addition, the jis0201.flc file should be replaced likewise by
the verbatim contents of
http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/JIS0201.TXT ."
This commit replaces files with licensing problems with those listed
by John Cowan.
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Same change made to showfigfonts, figlist can now use the local figlet
executable instead of the system executable.
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Environment variable FIGLET_FONTDIR can be used to set the path to search
for font files. This variable is used in the test script when FIGlet is
installed on a staging directory.
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Make sure the binary built from the distribution package uses a local
font directory to run tests.
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Linefeed characters are printed differently depending of the shell
used as /bin/sh. Use an extra echo to prevent output problems.
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Show version info in serveral files including README, FAQ and manual
pages when building the distribution package, to ensure consistency.
Output is like:
Infocode: 20204
Version: 2.2.4, date: 26 January 2011
README: release 2.2.4, 26 January 2011
FAQ: The latest version of FIGlet is 2.2.4
.TH CHKFONT 6 "26 January 2011" "v2.2.4"
.TH FIGLET 6 "26 January 2011" "v2.2.4"
.TH FIGLIST 6 "26 January 2011" "v2.2.4"
.TH SHOWFIGFONTS 6 "26 January 2011" "v2.2.4"
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
The following tests have been added:
test 017: tlf2 kerning flush-right mode
test 018: tlf2 overlap centered mode
test 019: tlf2 full-width flush-left right-to-left mode
test 020: specify font directory
test 021: paragraph mode long line output
test 022: short line output
test 023: kerning paragraph centered mode (small)
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Use outchr as the ouput character type (instead of char) when computing
kerning, to prevent corruption with tlf2 fonts
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>