[Debian-hebrew-package] [svn] r312 - pkg/bidiv/trunk
Baruch Even
baruch at costa.debian.org
Sat Jan 7 22:20:50 UTC 2006
Author: baruch
Date: Sat Jan 7 22:20:50 2006
New Revision: 312
Added:
pkg/bidiv/trunk/COPYING
- copied unchanged from r310, pkg/bidiv/branches/upstream/current/COPYING
Removed:
pkg/bidiv/trunk/COMPILE
pkg/bidiv/trunk/bidiv.spec
Modified:
pkg/bidiv/trunk/README
pkg/bidiv/trunk/WHATSNEW
pkg/bidiv/trunk/bidiv.1
pkg/bidiv/trunk/bidiv.c
Log:
Merge from upstream 1.5 to trunk
Modified: pkg/bidiv/trunk/README
==============================================================================
--- pkg/bidiv/trunk/README (original)
+++ pkg/bidiv/trunk/README Sat Jan 7 22:20:50 2006
@@ -10,9 +10,9 @@
This is why I wrote a very simple program based on Fribidi, that acts as a
filter or viewer (with similar semantics as the 'cat' command) for logical-
-order ISO-8859-8 files: The logical ISO-8859-8 is converted to visual
-ISO-8859-8 assuming a fixed number of characters per line (automatically
-determined or given with the -w parameter).
+order ISO-8859-8 or UTF8 files: The logical text is converted to visual
+ISO-8859-8 (or UTF8) assuming a fixed number of characters per line
+(automatically determined or given with the -w parameter).
I called this program 'bidiv', for "bidi viewer". You can get it in
ftp://ftp.ivrix.org.il/pub/ivrix/src/cmdline/bidiv-1.0.tgz
@@ -29,5 +29,5 @@
----------------------------------------------------------------------------
-Copyright (c) 2001 Nadav Har'El
-License: GNU General Public License
+Copyright (c) 2001-2006 Nadav Har'El
+License: GNU General Public License version 2
Modified: pkg/bidiv/trunk/WHATSNEW
==============================================================================
--- pkg/bidiv/trunk/WHATSNEW (original)
+++ pkg/bidiv/trunk/WHATSNEW Sat Jan 7 22:20:50 2006
@@ -1,3 +1,12 @@
+Release 1.5: Jan 7, 2006
+ * Fixed buffer size error that caused buffer overflows (and crashes) in
+ certain cases. Thanks to Dan Kenigsberg and to Shachar Raindel for
+ reporting the bug and suggesting patches.
+ * Update bidiv(1) manual to reflect bidiv's UTF8 capabilities (that already
+ existed in release 1.4).
+ * Clarify GPL license in bidiv.c and README, and include GPL's "COPYING"
+ license file in the bidiv distribution.
+
Release 1.4: Oct 21, 2002
* Fix auto direction so that if the first line of a paragraph has no
direction, the direction of the previous paragraph is used temporarily.
Modified: pkg/bidiv/trunk/bidiv.1
==============================================================================
--- pkg/bidiv/trunk/bidiv.1 (original)
+++ pkg/bidiv/trunk/bidiv.1 Sat Jan 7 22:20:50 2006
@@ -1,6 +1,6 @@
'\" t
.\" Copyright (c) 2001, Nadav Har'El
-.TH bidiv 1 "19 Feb 2001" "Bidiv" "Ivrix"
+.TH bidiv 1 "7 Jan 2006" "Bidiv" "Ivrix"
.SH NAME
bidiv \- bidirectional text filter
.SH SYNOPSIS
@@ -14,19 +14,24 @@
.BI [\| file\|.\|.\|. \|]
.SH DESCRIPTION
.B bidiv
-is a filter, or viewer, for birectional text stored in logical-order, into
-visual-order 8-bit text which can be viewed on terminals that do not handle
+is a filter, or viewer, for birectional text stored in logical-order. It
+converts such text into
+visual-order text which can be viewed on terminals that do not handle
bidirectionality. The output visual-order text is formatted
assuming a fixed number of characters per line (automatically determined
or given with the
.B -w
parameter).
-The current version is oriented towards Hebrew, and therefore reads
-ISO-8859-8-i (logical) encoded text and outputs ISO-8859-8 (visual) encoded
-text. However,
.B bidiv
-can be easily adapted to other encodings and right-to-left languages.
+is oriented towards Hebrew, and assumes the input to be
+a Hebrew and ASCII text encoded in one of the two common logical-order
+encodings: ISO-8859-8-i or UTF-8. Actually, bidiv guesses the encoding of its
+input at a character by
+character basis, so the input might be a mix of ISO-8859-8-i and Hebrew UTF-8.
+.BR bidiv 's
+output is visual-order text, in either the ISO-8859-8
+or UTF-8 encoding, depending on your locale setting.
.B bidiv
reads each
@@ -104,8 +109,8 @@
case is rare, but does happen under random line-splitting circumstances, or
when the text is defining words of a foreign language.
-TODO: maybe add another option to choose direction based on _input_ line. Would
-that be useful at all? I doubt it.
+.\"TODO: maybe add another option to choose direction based on _input_ line. Would
+.\"that be useful at all? I doubt it.
.TP
.B \-j
Do not justify:
@@ -113,7 +118,8 @@
on the left when shorter than the required line width (see the
.B \-w
option). The
-.B \-j option tells
+.B \-j
+option tells
.B bidiv
not to preform this justifications, and leave short lines unpadded.
.TP
@@ -172,7 +178,7 @@
.TP 3
3.
set "bidiv" as a filter for your mail program (mutt, pine, etc.) for viewing
-mail with the ISO 8859-8-i character set.
+mail with the ISO 8859-8-i character set, and Hebrew UTF-8 mail.
.SH ENVIRONMENT
.B COLUMNS
Modified: pkg/bidiv/trunk/bidiv.c
==============================================================================
--- pkg/bidiv/trunk/bidiv.c (original)
+++ pkg/bidiv/trunk/bidiv.c Sat Jan 7 22:20:50 2006
@@ -11,10 +11,10 @@
TODO: This should be a general utility which is useful not only to Hebrew:
it should work for Arabic and other RL languages too.
- Copyright (c) 2001 Nadav Har'El
- License: GNU General Public License
+ Copyright (c) 2001-2006 Nadav Har'El
+ License: GNU General Public License version 2
- This is version 1.4. See WHATSNEW file for version history.
+ This is version 1.5. See WHATSNEW file for version history.
*/
#include <stdio.h>
@@ -50,9 +50,9 @@
bidiv(FILE *fp)
{
#ifndef TRY_UTF8
- unsigned char *in;
+ char *in;
#endif
- unsigned char *out;
+ char *out;
FriBidiChar *unicode_in, *unicode_out;
int len, i, c;
int rtl_line;
@@ -72,6 +72,11 @@
#endif
out=(unsigned char *)malloc(width*7+1); /* 7 is the maximum number of
bytes in one UTF8 char? */
+ /* We use (width+1) not just width, to leave place for a double-
+ width null character, which we might or might not need to write
+ (we don't add one to unicode_in, but it appears that fribidi_log2vis
+ puts one (a single null byte?) in unicode_out). But it can't hurt
+ to be extra safe and leave 2 extra bytes on both. */
unicode_in=(FriBidiChar *)malloc(sizeof(FriBidiChar)*(width+1));
unicode_out=(FriBidiChar *)malloc(sizeof(FriBidiChar)*(width+1));
@@ -217,7 +222,7 @@
putchar(' ');
puts(out);
}
- // Free the memory we have allocated
+ /* Free the memory we have allocated */
free(in);
free(out);
free(unicode_in);
More information about the Debian-hebrew-package
mailing list