FreeBSD Bugzilla – Attachment 173345 Details for
Bug 211614
[PATCH] games/cowsay: cowsay doesn't handle UTF8 properly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Fixed files/patch-cowsay
patch-cowsay (text/plain), 1.00 KB, created by
Aleksander Alekseev
on 2016-08-05 22:37:20 UTC
(
hide
)
Description:
Fixed files/patch-cowsay
Filename:
MIME Type:
Creator:
Aleksander Alekseev
Created:
2016-08-05 22:37:20 UTC
Size:
1.00 KB
patch
obsolete
>$NetBSD: patch-aa,v 1.1.1.1 2000/03/25 20:13:24 jlam Exp $ > >--- cowsay.orig 2016-06-25 02:45:15 UTC >+++ cowsay >@@ -7,11 +7,18 @@ > ## > > use Text::Tabs qw(expand); >-use Text::Wrap qw(wrap fill $columns); >+use Text::Wrap qw(wrap $columns); > use File::Basename; > use Getopt::Std; > use Cwd; > >+if (${^UTF8LOCALE}) { >+ binmode STDIN, ':utf8'; >+ binmode STDOUT, ':utf8'; >+ require Encode; >+ eval { $_ = Encode::decode_utf8($_,1) } for @ARGV; >+} >+ > $version = "3.03"; > $progname = basename($0); > $eyes = "oo"; >@@ -185,3 +185,20 @@ Usage: $progname [-bdgpstwy] [-h] [-e ey > [-l] [-n] [-T tongue] [-W wrapcolumn] [message] > EOF > } >+ >+sub fill { >+ my ($ip, $xp, @raw) = @_; >+ my @para; >+ my $pp; >+ >+ for $pp (split(/\n\s+/, join("\n",@raw))) { >+ $pp =~ s/\s+/ /g; >+ my $x = wrap($ip, $xp, $pp); >+ push(@para, $x); >+ } >+ >+ # if paragraph_indent is the same as line_indent, >+ # separate paragraphs with blank lines >+ >+ return join ($ip eq $xp ? "\n\n" : "\n", @para); >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 211614
:
173345
|
173346
|
173347