repo.or.cz
/
plumiferos.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merge branch 'db/rev'
[plumiferos.git]
/
source
/
tools
/
wrap.pl
blob
d77d3ef595efc95b2ebeb26ecb7e63c3fcf7d1ce
1
#!/usr/bin/env perl
2
3
$linelength
=
72
;
4
$indent
=
" "
;
5
6
while
(<>)
7
{
8
@words
=
split
" "
,
$_
;
9
$loc
=
length
(
$indent
);
10
printf
"
$indent
"
;
11
foreach
$word
(
@words
){
12
if
((
length
(
$word
) +
1
+
$loc
) >
$linelength
) {
13
printf
"
\n
$indent
"
;
14
$loc
=
length
(
$indent
);;
15
}
16
printf
"
$word
"
;
17
$loc
+=
length
(
$word
) +
1
;
18
}
19
printf
"
\n
"
;
20
}
21