Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/externals/cowsay/Wrap.pm.diff
12240 views
1
*** Wrap.pm.in Thu May 22 00:21:42 1997
2
--- Wrap.pm Fri Nov 12 10:00:15 1999
3
***************
4
*** 3,9 ****
5
require Exporter;
6
7
@ISA = (Exporter);
8
! @EXPORT = qw(wrap);
9
@EXPORT_OK = qw($columns);
10
11
$VERSION = 97.011701;
12
--- 3,9 ----
13
require Exporter;
14
15
@ISA = (Exporter);
16
! @EXPORT = qw(wrap fill);
17
@EXPORT_OK = qw($columns);
18
19
$VERSION = 97.011701;
20
***************
21
*** 66,71 ****
22
--- 66,90 ----
23
24
print "-----------$r---------\n" if $debug;;
25
return $r;
26
+ }
27
+
28
+ ## Copied up from below.
29
+ sub fill
30
+ {
31
+ my ($ip, $xp, @raw) = @_;
32
+ my @para;
33
+ my $pp;
34
+
35
+ for $pp (split(/\n\s+/, join("\n",@raw))) {
36
+ $pp =~ s/\s+/ /g;
37
+ my $x = wrap($ip, $xp, $pp);
38
+ push(@para, $x);
39
+ }
40
+
41
+ # if paragraph_indent is the same as line_indent,
42
+ # separate paragraphs with blank lines
43
+
44
+ return join ($ip eq $xp ? "\n\n" : "\n", @para);
45
}
46
47
1;
48
49