aboutsummaryrefslogtreecommitdiffstats
path: root/doc/misc/format-options.pl
diff options
context:
space:
mode:
authorDoug Barton <dougb@FreeBSD.org>2008-12-23 18:35:21 +0000
committerDoug Barton <dougb@FreeBSD.org>2008-12-23 18:35:21 +0000
commit2fabdf5789e562f51310270bef3cb863c0dc920b (patch)
treed25d756be8550df073eb3ed4e5b39831380291b5 /doc/misc/format-options.pl
parente086bf114fd88cb7f882d66afe4492fe5659bcf2 (diff)
downloadsrc-2fabdf5789e562f51310270bef3cb863c0dc920b.tar.gz
src-2fabdf5789e562f51310270bef3cb863c0dc920b.zip
Vendor import of BIND 9.4.3vendor/bind9/9.4.3
Notes
Notes: svn path=/vendor/bind9/dist/; revision=186448 svn path=/vendor/bind9/9.4.3/; revision=186449; tag=vendor/bind9/9.4.3
Diffstat (limited to 'doc/misc/format-options.pl')
-rw-r--r--doc/misc/format-options.pl29
1 files changed, 21 insertions, 8 deletions
diff --git a/doc/misc/format-options.pl b/doc/misc/format-options.pl
index 70b334e31e1e..aa433b3d168d 100644
--- a/doc/misc/format-options.pl
+++ b/doc/misc/format-options.pl
@@ -1,9 +1,9 @@
#!/usr/bin/perl
#
-# Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2001 Internet Software Consortium.
#
-# Permission to use, copy, modify, and distribute this software for any
+# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
@@ -15,7 +15,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: format-options.pl,v 1.2 2004/03/05 05:04:53 marka Exp $
+# $Id: format-options.pl,v 1.2.18.2 2007/12/02 23:46:31 tbox Exp $
print <<END;
@@ -26,11 +26,24 @@ END
# Break long lines
while (<>) {
+ chomp;
s/\t/ /g;
- if (length >= 79) {
- m!^( *)!;
- my $indent = $1;
- s!^(.{0,75}) (.*)$!\1\n$indent \2!;
+ my $line = $_;
+ m!^( *)!;
+ my $indent = $1;
+ my $comment = "";
+ if ( $line =~ m!//.*! ) {
+ $comment = $&;
+ $line =~ s!//.*!!;
}
- print;
+ my $start = "";
+ while (length($line) >= 79 - length($comment)) {
+ $_ = $line;
+ # this makes sure that the comment has something in front of it
+ $len = 75 - length($comment);
+ m!^(.{0,$len}) (.*)$!;
+ $start = $start.$1."\n";
+ $line = $indent." ".$2;
+ }
+ print $start.$line.$comment."\n";
}